473,387 Members | 1,489 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Assing Picture1.Picture to Image1.Picture

Hi,

Is it possible to assign the Picture property of a picturebox to the
Picture property of an image control?

I use an invisble picturebox to make some changes to a picture, but I
want to show the picture in an imagecontrol, since the image is very
large and I want to stretch it.

But when I execute the following code:

Image1.Picture = Picture1.Picture
Image1.Refresh

The image control Image1 stays empty. What am I doing wrong?

Thanks in advance,
Sandra
Jul 17 '05 #1
3 10426
Hello Sandra,

What you can do, it using an imagelist (project -> components -> microsoft
windows common controls 5.0 / or 6.0).
Open the imagelist's property dialog (right mouse click on the control ->
properties) and add the image to the list.
Fill some name in the key box (e.g. "MyPic").

Then bind the imagecontrol and the picturebox to the imagelist:

Image1.Picture = ImageList1.ListImages.Item("MyPic").Picture
Picture1.Picture = ImageList1.ListImages.Item("MyPic").Picture

and voila !

Good luck,
Ramon.
"Sandra Setz" <ss***@wxs.nl> wrote in message
news:74**************************@posting.google.c om...
Hi,

Is it possible to assign the Picture property of a picturebox to the
Picture property of an image control?

I use an invisble picturebox to make some changes to a picture, but I
want to show the picture in an imagecontrol, since the image is very
large and I want to stretch it.

But when I execute the following code:

Image1.Picture = Picture1.Picture
Image1.Refresh

The image control Image1 stays empty. What am I doing wrong?

Thanks in advance,
Sandra

Jul 17 '05 #2
On 12 Aug 2004 01:35:45 -0700, ss***@wxs.nl (Sandra Setz) wrote:
Hi,

Is it possible to assign the Picture property of a picturebox to the
Picture property of an image control?

I use an invisble picturebox to make some changes to a picture, but I
want to show the picture in an imagecontrol, since the image is very
large and I want to stretch it.

But when I execute the following code:

Image1.Picture = Picture1.Picture
Image1.Refresh

The image control Image1 stays empty. What am I doing wrong?


1) Autoredraw
2) Set X = Picture1.Image

The Picture of a Picturebox stays the same when you tinker with
Picture1.Image
Jul 17 '05 #3
er*****@nowhere.com (J French) wrote :
1) Autoredraw
2) Set X = Picture1.Image

The Picture of a Picturebox stays the same when you tinker with
Picture1.Image


Yes, this did the trick for me. Thanks!!!

Sandra
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: jeff | last post by:
Hiya, Im currently in the process of developing a picture browser, I want it to run off a CD, basically I have 2 questions for the group. The first is how do I get the program to only view the...
2
by: Sandra Setz | last post by:
Hi, I was wondering if someone could explain to me what the difference is between the width propery of the picture property of an image and the width property of the image itself. I would...
8
by: marslee | last post by:
I know how to use buttons to go to the next and previous picture in slide show, but i want to change it so when the user clicks the picture instead of button, the script shows the next phicture. ...
0
by: wolf | last post by:
Hi I had put a PictureBox and three Buttons on a Form. I want the PictureBox show the 1.gif if I click button1 and show 2.gif if I click button2 and so on. But while it running, the value of...
4
by: janie66 | last post by:
Hi guys Can anyone please help me out i need to display image on form .i have a requirment iam pulling data from query... PRDID PRDNAME PRDPIC 01 XYX ...
1
by: nowitsoverx | last post by:
I'm just trying to test something out to see if I can get it working but I'm a little stuck. I have two frames. The left one has a menu of radio buttons. I want it so when you click on the radio...
3
by: mpratheepa | last post by:
How to get a picture file (*.jpg extension) in Image tool box in the form during run time. I used Image1.Picture = LoadPicture(photoname) photoname is from table which contains file name...
12
sgrec7
by: sgrec7 | last post by:
hey guys, guess what, i've got another problem for you!! i want it so that when image1 touches image2, a "crashed message" appears this dosen't work: private sub form1_keypress (keyascii...
2
by: junkmatred | last post by:
Please help guys, Picture1.hdc is returning a different value than GetDC(Picture1.hwnd) Look at the source code I've provided. This doesn't make any sense! I need help! Option Explicit...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.