SavePicture Command

Purpose

Saves a Picture object to a file.

Syntax

SavePicture picture, file$

picture:Picture Object
file$:sexp, filename

Description

Saves a graphic from the Picture or Image property of an object or control (if one is associated with it) to a file.

If a graphic was loaded from a file to the Picture property of an object, either at design time or at run time, and it’s a bitmap, icon, metafile, or enhanced metafile, it's saved using the same format as the original file. If it is a GIF or JPEG file, it is saved as a bitmap file.

Graphics in an Image property are always saved as bitmap (.bmp) files regardless of their original format.

Interesting, is the possibility to save the AutoRedraw bitmap, because the Picture object is returned with the Image property.

Example

OpenW 1, 0, 0, 200, 200

AdjustW 1, 200, 200

AutoRedraw = 1

For i = 0 To 500

Color RGB(i * 5, i * 6, i * 7)

Circle 100, 100, i

Next

Global i%

SavePicture Me.Image, "c:\Test.Bmp"

Do

Sleep

Until Me Is Nothing

Kill "c:\test.bmp"  // Tidy-up line

See Also

Picture, Form

{Created by Sjouke Hamstra; Last updated: 22/10/2014 by James Gaite}