<div class="meta" robots="noindex">

</div>

Method

# Picture.GetData

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `Picture.ToData<picture.todata>` as a replacement.

</div>

## Description

Converts the **Picture** to a `MemoryBlock</api/language/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 <span class="title-ref">GetData</span> to convert an image in an `ImageWell</api/deprecated/imagewell>` into a `MemoryBlock</api/language/memoryblock>`

``` xojo
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.
