Specifies a character string expression or object that represents an image for the Image control.
Image.PictureVal [= eExpression]
Specifies a character string expression or object that represents an image.
If eExpression is a string expression, it must be a valid expression that GDI+ can use to render an image. For example, it could be an expression derived from code as in the following example.
cPict = FILETOSTR('myimage.bmp') oForm.Img1.PictureVal = cPict
eExpression can also be a string expression that represents a memo or blob type field containing strict binary data. For example, you can use the to import an image into a memo field. You cannot use a general type field for eExpression because general fields store additional unrelated binary data.
If eExpression is an object, the object must implement one of the following interfaces: “Picture” or “IPicture”.
The “Picture” default interface is the same returned by the .
If you need the “IPicture”-interface, you can get it using .
oPict = LOADPICTURE(“myimage.bmp”) oForm.img1.PictureVal = oPict * or oPict = LOADPICTURE(“myimage.bmp”) oIPicture = GETINTERFACE(oPicture, 'iPicture') oform.img.PictureVal = oIPicture && IPICTURE is a secondary interface that can be useful calling COM objects.
The PictureVal property takes precedence over theif both are specified.
Note that Visual FoxPro only uses the memory required to render an image when the image is stored in a memo or blob field. This is a memory efficient way to display images in Visual FoxPro. However, using a file reference in the PictureVal property requires Visual FoxPro to use up to twice the amount of memory as the size of the file. For example, if you reference a 5 MB image file, Visual FoxPro requires up to 10MB of memory to display the file.
You cannot specify a mask (MSK) file with the PictureVal property. If you are using BMP images and want a mask, you should use the Picture property instead. You can also use a different image format such as GIF which has transparency defined within the image.