PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Zoom on an image
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Warning
From version 18, this function is kept for backward compatibility for most of the platforms. It is recommended to use dCopy. Indeed:
  • dCopy manages transparency,
  • the different copy modes of dCopyBlt are replaced with:
Copies an image:
  • from an Image control to another Image control.
  • in a variable of type Image.
Example
// Simple copy of content from the "IMG_ImageDrawing" control
// into the "IMG_ImageCopy" Image control
ResCopy = dCopyBlt(IMG_ImageDrawing, IMG_ImageCopy)
Reports and Queries
// Copy the image of the screen into an Image control
dCopyBlt(copyScreen, IMG_MyImage)
Syntax

Copying images from Image controls Hide the details

<Result> = dCopyBlt(<Source image control> , <Destination Image control> [, <Copy mode> [, <Source image X-coordinate> [, <Source image Y-coordinate> [, <Source image height> [, <Source image width> [, <Destination image X-coordinate> [, <Destination image Y-coordinate> [, <Destination image height> [, <Destination image width>]]]]]]]]])
<Result>: Boolean
  • True if the image was copied,
  • False otherwise.
Remark: dCopyBlt can return False if the screen driver does not support this function. In this case, a message is displayed in the copied image. We recommend that you update your screen driver in order to get the proper behavior.
<Source image control>: Control name
Name of the source Image control to be used.
To take a screenshot, use the copyScreen constant: the entire screen content is copied.
<Destination Image control>: Control name
Name of the destination Image control the image will be copied to.
<Copy mode>: Optional constant
Copy mode to be used.
copyBlacknessFills the destination Image control with black.
copyDstInvertInverts the colors of the destination Image control.
copyImageCombines the source image with the destination image using the transparency information of the destination image
Can be used to include a logo in the destination image for example.
Remark: The size and position in the source are ignored. No homothety and no zoom are allowed in this mode.
copyMergeCopyMerges the source Image control and the destination Image control.
copyMergePaintCombines the source Image control with the "pattern" of the destination Image control via the "Logical AND" method.
copyNotSrcCopyInverts the colors of the source Image control.
copyNotSrcEraseInverts the combination between the source and the destination Image controls via the "OR" method.
copyPatCopyCopies the "pattern" from the source Image control to the destination Image control.
copyPatInvertCombines the pattern of the source and destination Image controls via the "XOR" (Exclusive Or) method. The current brush, defined by dBackground, is used.
copyPatPaintCombines the inverted source Image control with the "pattern" of the destination Image control via the "OR" method.
copySrcAndCombines the pixels of the source and destination Image controls via the "AND" method.
copySrcCopy
(Default value)
Copies the source Image control to the destination Image control (simple copy).
copySrcEraseInverts the destination Image control and combines the result with the copy of the source Image control.
copySrcInvertCombines the pixels of the source and destination Image controls via the "XOR" (Exclusive Or) method.
copySrcPaintCombines the pixels of the source and destination Image controls via the "OR" method.
copyWhitenessFills the destination Image control with white.
<Source image X-coordinate>: Optional integer
X-coordinate (in pixels) of the upper-left corner of the area to copy (upper-left corner of the source Image control by default).
<Source image Y-coordinate>: Optional integer
Y-coordinate (in pixels) of the upper-left corner of the area to copy (upper-left corner of the source Image control by default).
<Source image height>: Optional integer
Height (in pixels) of the area to copy (height of the source Image control by default).
<Source image width>: Optional integer
Width (in pixels) of the area to copy (width of the source Image control by default).
<Destination image X-coordinate>: Optional integer
X-coordinate (in pixels) of the upper-left corner of the copy destination area (upper-left corner of the destination Image control by default).
<Destination image Y-coordinate>: Optional integer
Y-coordinate (in pixels) of the upper-left corner of the copy destination area (upper-left corner of the destination Image control by default).
<Destination image height>: Optional integer
Height (in pixels) of the area the image will be copied to (height of the destination Image control by default). If this height is greater than the height of the source image, the image will be enlarged when copied.
<Destination image width>: Optional integer
Width (in pixels) of the area the image will be copied to (width of the destination Image control by default). If this width is greater than the width of the source image, the image will be enlarged when copied.
Reports and Queries

Copying the images found in the Image variables Hide the details

<Result> = dCopyBlt(<Source image name> , <Destination image name> [, <Source image X-coordinate> [, <Source image Y-coordinate> [, <Source image height> [, <Source image width> [, <Destination image X-coordinate> [, <Destination image Y-coordinate> [, <Destination image height> [, <Destination image width>]]]]]]]])
<Result>: Boolean
  • True if the image was copied,
  • False otherwise.
Remark: dCopyBlt can return False if the screen driver does not support this function. In this case, a message is displayed in the copied image. We recommend that you update your screen driver in order to get the proper behavior.
<Source image name>: Image variable
Name of the Image variable to be used. This image is the source image.
<Destination image name>: Image variable
Name of the Image variable the image will be copied to.
<Source image X-coordinate>: Optional integer
X-coordinate (in pixels) of the upper-left corner of the area to copy (upper-left corner of the source image by default).
<Source image Y-coordinate>: Optional integer
Y-coordinate (in pixels) of the upper-left corner of the area to copy (upper-left corner of the source image by default).
<Source image height>: Optional integer
Height (in pixels) of the area to copy (height of the source image by default).
<Source image width>: Optional integer
Width (in pixels) of the area to copy (width of the source image by default).
<Destination image X-coordinate>: Optional integer
X-coordinate (in pixels) of the upper-left corner of the copy destination area (upper-left corner of the destination image by default).
<Destination image Y-coordinate>: Optional integer
Y-coordinate (in pixels) of the upper-left corner of the copy destination area (upper-left corner of the destination image by default).
<Destination image height>: Optional integer
Height (in pixels) of the area the image will be copied to (height of the destination image by default). If this height is greater than the height of the source image, the image will be enlarged when copied.
<Destination image width>: Optional integer
Width (in pixels) of the area the image will be copied to (width of the destination image by default). If this width is greater than the width of the source image, the image will be enlarged when copied.
Remarks

Zoom on an image

During a copy, you can enlarge or reduce a section of the source image when copying it to the destination image. To do so:
  • Define the area to enlarge (or reduce) in the source image (with the <Source image X-coordinate>, <Source image Y-coordinate>, <Source image height> and <Source image width> parameters),
  • Define the display area of the result image. This area must be larger to enlarge the image and smaller to reduce the image. By default, the entire destination image is taken into account. Use <Destination image X-coordinate>, <Destination image Y-coordinate>, <Destination image height> and <Destination image width> if necessary.
The zoom percentage depends on the multiplying coefficient between the dimensions of the two areas.
For example:
1. The area to zoom is included in a rectangle whose width is et to 30 pixels and whose height is set to 40 pixels.2. To perform a 200% zoom, the destination area must be twice the size of the source area: rectangle whose width is set to 60 pixels and whose height is set to 80 pixels.
area to zoom in
zoomed area
In this case, the following line of code is used to perform the zoom operation during the copy:
dCopyBlt(IMG_SourceControl, IMG_DestinationControl, copySrcCopy, 10, 10, 30, 40, 10, 10, 60, 80)
Component: wd270obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment