PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Saving the content of an Image control in PNG format
dSaveImagePNG (Example)
Saving the content of an Image control in PNG format
The following code is used to save the content of an Image control (IMG_ImageDrawing) in PNG format. The PNG file is selected via fSelect.
In this example, we will assume that the Image control (IMG_ImageDrawing) contains one image or several drawings.
// -- Click code on BTN_Save
// Declare the variables
FilePath is string
ResSave is boolean
// Select the PNG file
FilePath = fSelect("C:\MyDirectories" , "", "Select a file", ...
"PNG file (*.PNG)" + TAB + "*.PNG", "*.PNG", fselCreate)
IF FilePath <> "" THEN
// Save the content of the "IMG_ImageDrawing" control
ResSave = dSaveImagePNG(IMG_ImageDrawing, FilePath)
// Saved successfully?
IF ResSave = True THEN
Info("Saved successfully")
ELSE
Error(ErrorInfo(errMessage))
END
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment