Method
Picture.GetData
Warning
This item was deprecated in version 2019r2. Please use Picture.ToData as a replacement.
Description
Converts the Picture to a MemoryBlock.
Notes
Valid formats are: * Picture.FormatBMP (not supported in Console apps) * Picture.FormatGIF (not supported in Console apps) * Picture.FormatJPEG * Picture.FormatPNG * Picture.FormatTIFF (not supported in Console apps)
If you are using the JPEG format, then there is an optional parameter for the quality of the JPEG. You specify the quality using the following class constants instead of the literal values. Introduced 2010r5
Constant |
Value |
---|---|
QualityDefault |
-1 |
QualityMax |
100 |
QualityHigh |
80 |
QualityMedium |
50 |
QualityLow |
25 |
QualityMin |
0 |
Sample code
This example uses GetData to convert an image in an ImageWell into a MemoryBlock
Dim mb As MemoryBlock
If productImageWell.Image <> Nil Then
' Get the image data
mb = ProductImageWell.Image.GetData(Picture.FormatJPEG, Picture.QualityHigh)
' convert the memoryblock back into an image
Imagewell2.Image = Picture.FromData(mb)
End If
Compatibility
All project types on all supported operating systems.