ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Drawing functions
  • Example 1: Copying an image
  • Example 2: Zoom on an image
dCopyImage (Example)
Example 1: Copying an image
WINDEVWEBDEV - Server codeReports and QueriesWindowsUser code (UMC)PHPAjax
The following code is used to copy the content of an Image control (IMG_SourceImage) into a second Image control (IMG_DestinationImage). The user selects the copy mode via a List Box control (LIST_ListMode).
// Declare the variables
ResCopy is boolean
CopyMode is int
 
// Retrieve the copy mode
SWITCH LIST_ListMode
CASE 1: CopyMode = copyBlackness
CASE 2: CopyMode = copyDstInvert
CASE 3: CopyMode = copyMergeCopy
CASE 4: CopyMode = copyNotSrcCopy
CASE 5: CopyMode = copyNotSrcErase
CASE 6: CopyMode = copySrcAnd
CASE 7: CopyMode = copySrcCopy
CASE 8: CopyMode = copySrcErase
CASE 9: CopyMode = copySrcInvert
CASE 10: CopyMode = copySrcPaint
CASE 11: CopyMode = copyWhiteness
CASE 12: CopyMode = copyMergePaint
CASE 13: CopyMode = copyPatCopy
CASE 14: CopyMode = copyPatInvert
CASE 15: CopyMode = copyPatPaint
END
 
// Copy the content of the Image control
ResCopy = dCopyImage(IMG_SourceImage, IMG_DestinationImage, CopyMode)
 
// Error?
IF ResCopy = True THEN
Info("The copy was performed")
ELSE
Info("The copy was not performed")
END
Example 2: Zoom on an image
The following code is used to reduce by 50% an image displayed in an Image control (IMG_SourceImage) whose coordinates are (0,0), (150,200). The reduced-size image is copied into a second Image control (IMG_DestinationImage).
// Declare the variables
ResCopy is boolean
 
// Reduce the size of the selected image
ResCopy = dCopyImage(IMG_SourceImage, IMG_DestinationImage,...
copySrcCopy, 0, 0, 150, 200, 0, 0, 75, 100)
 
// Error?
IF ResCopy = True THEN
Info("The reduce operation was performed")
ELSE
Info("The reduce operation was not performed")
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 02/10/2023

Send a report | Local help