Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

image object 1

Status
Not open for further replies.

LaMancha

Technical User
May 23, 2003
20
US
hi,
i want to make an image object and load a picture into it.
this piece of code does not work:

Dim AA As Image
Set AA = Image
AA.Picture = LoadPicture(FileName)

(
i solved the problem of loading images to the image control box (see previous thread by me), now i am trying to have all control over the image.
)
 

try...
[tt]
Dim Pic As stdPicture

Set Pic = LoadPicture(FileName)
[/tt]

This will load a picture into memory, which it seems that you are trying to do.

Good Luck

 
thank you,

however i am really curious, how can the image object be used?
 

From the help files...
[tt]
The Image, DragIcon, and Picture properties are normally used when assigning values to other properties, when saving with the SavePicture statement, or when placing something on the Clipboard. You can't assign these to a temporary variable, other than the Picture data type.

The AutoRedraw property can cause Image, which is a handle to a bitmap, to change. When AutoRedraw is True, an object's hDC property becomes a handle to a device context that contains the bitmap returned by Image.
[/tt]

So what I infer from this is that...
[tt]
Dim Img As Image
[/tt]
Will not work but...
[tt]
Dim Pic As stdPicture
[/tt]
will. (could be wrong)

and also from the help files...
[tt]
The object placeholder represents an object expression that evaluates to an object in the Applies To list. ...

Form Object, Forms Collection
PictureBox Control
PropertyPage Object
UserControl Object
UserDocument Object
[/tt]

Which means to me that to use an Image object it needs to have a "window" of which a variable does not have a device context associated with unlike a form or picture box.

Good Luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top