- Zoom on an image
- Pattern and PHP
- Drawing in Browser code
dCopyBlt (Function) In french: dCopieImage
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 by:
// Simple copy of content from the "IMG_ImageDrawing" control // into the "IMG_ImageCopy" Image control ResCopy = dCopyBlt(IMG_ImageDrawing, IMG_ImageCopy)
Syntax
Copying the images found in the Image controls Hide the details
<Result> = dCopyBlt(<Source image control> , <Destination Image control> [, <Copy mode> [, <X source image> [, <Y source image> [, <Height source image> [, <Width source image> [, <X destination image> [, <Y destination image> [, <Height destination image> [, <Width destination image>]]]]]]]]])
<Result>: Boolean - True if the copy was performed,
- 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 source Image control to use. To take a screenshot, use the copyScreen constant: the entire screen content is copied.
Versions 18 and later New in version 18 <Destination Image control>: Control name Name of destination Image control where the copy will be performed.
Versions 18 and later New in version 18 <Copy mode>: Optional constant Mode of copy to perform. | | copyDstInvert | Reverses the colors of destination Image control. | copyImage | Combines the source image and the destination image by using the transparency information of 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. | copyMergeCopy | Merges the source Image control and the destination Image control. | copyMergePaint | Combines, via the "Logical AND" method, the source Image control and the "pattern" of destination Image control. | copyPatCopy | Copies the "pattern" of source Image control into the destination Image control. | copyPatInvert | Combines, via the "Exclusive Or" method, the pattern of source Image control and the "pattern" of destination Image control. The current brush, defined by dBackground, is used. | copyPatPaint | Combines, via the "Or" method, the inverted source Image control and the "pattern" of destination Image control. | copyNotSrcCopy | Reverses the colors of source Image control. | copyNotSrcErase | Reverses, via the "Or" method, the combination between the source Image control and the destination Image control. | copySrcCopy (Default value) | Copies the source Image control into the destination Image control (simple copy). | copySrcErase | Reverses the destination Image control and combines the result with the copy of source Image control. | copySrcAnd | Combines, via the "and" method, the pixels of the Image image control and the pixels of destination Image control. | copySrcInvert | Combines, via the "Exclusive Or" method, the pixels of the source Image control and the pixels of the destination Image control. | copySrcPaint | Combines, via the "Or" method, the pixels of source Image control and the pixels of destination Image control. | copyWhiteness | Fills the destination Image control with white. | copyBlackness | Fills the destination Image control with black. |
<X source image>: Optional integer X coordinate (in pixels) of top left corner of the area to copy (top left corner of source Image control by default). <Y source image>: Optional integer Y coordinate (in pixels) of top left corner of the area to copy (top left corner of source Image control by default). <Height source image>: Optional integer Height (in pixels) of the area to copy (height of source Image control by default). <Width source image>: Optional integer Width (in pixels) of the area to copy (width of source Image control by default). <X destination image>: Optional integer X coordinate (in pixels) of top left corner of the destination area for the copy (top left corner of destination Image control by default). <Y destination image>: Optional integer Y coordinate (in pixels) of top left corner of destination area for the copy (top left corner of destination Image control by default). <Height destination image>: Optional integer Height (in pixels) of the area where the image will be copied (height of destination Image control by default). If this height is greater than the height of source image, the image will be enlarged during the copy. <Width destination image>: Optional integer Width (in pixels) of the area where the image will be copied (width of destination Image control by default). If this width is greater than the width of source image, the image will be enlarged during the copy. Remarks 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 parameters <X source image>, <Y source image>, <Height source image> and <Width source image>),
- 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 <X destination image>, <Y destination image>, <Height destination image> and <Width destination image> 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. | | |
In this case, the following code line is used to perform the zoom operation during the copy:
dCopyBlt(IMG_SourceControl, IMG_DestinationControl, copySrcCopy, 10, 10, 30, 40, 10, 10, 60, 80)
Versions 16 and later New in version 16
This page is also available for…
|
|
|