Compartir a través de


PictureVal Property

Specifies a character string expression or object that represents an image for the Image control.

Image.PictureVal [= eExpression]

Return Value

  • 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 APPEND MEMO Command 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 be in an IPicture interface format. The IPicture interface format is the same format returned by the LOADPICTURE( ) Function.

    oPict = LOADPICTURE(“myimage.bmp”)
    oForm.img1.PictureVal = oPict
    

Remarks

Applies to: Image Control (Visual FoxPro)

The PictureVal property takes precedence over the Picture Property (Visual FoxPro) if 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.

See Also

Reference

LOADPICTURE( ) Function

Graphics Support in Visual FoxPro