how to embedd image in image control using imagelist. (1 Viewer)

sivakumari

Registered User.
Local time
Today, 10:14
Joined
Oct 7, 2004
Messages
13
Hi all ,
Can anyone tell me about how to embedd image in image control using imagelist.
I added the 5 images in imagelist at design time and added the following code.
image.picture=imagelist.listimages(1).picture
but iam getting error.error no :2110,cannot open the file .
thank u,
Siva
 

Process

New member
Local time
Today, 16:44
Joined
Mar 25, 2010
Messages
2
Hi Siva,
I have the same problem and have been chasing it for a while.

First your need to change image.picture= to
image.pictureDATA=
as picture refers to a file source! and what you are passing from the picture box is a bitmap. So the data is being interpreted as a file nane and hence the error message.

THIS IS WHERE IT GETS HARD!
The error will change to:
2192: The bitmap you specified is not in a device-independent bitmap (.dib) format.

I have tried to use an Attachment image and an imagelist but still get the same error.
I can load the image from a file using image.picture=C:/icon.ico but do not want to use external files in my UI.

So:
Does anyone know how to convert an imagelist image or an attachment image to a DIB (Device Independant Bitmap) please? or have i missed something?
Appreciate any suggestions...
 

SOS

Registered Lunatic
Local time
Yesterday, 21:44
Joined
Aug 27, 2008
Messages
3,517
If you are doing this in Access then I fear you are trying to use an item which is not valid within the Access environment. If you are not using Access then you have posted to the wrong forum category.
 

Process

New member
Local time
Today, 16:44
Joined
Mar 25, 2010
Messages
2
to SOS: Yes in access 2007
As stated have also tried to use attacment images and OLE images but all these seem to store the image in a bitmap rather than a DIB!
need to convert somhow!
Appreciate any ideas.
Think it needs to call GDI APIs....
 
Last edited:

Users who are viewing this thread

Top Bottom