PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Zoom on an image
  • Drawing in PHP
  • Drawing in Browser code
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Warning
From version 18, this function is kept for backward compatibility for most of the platforms. We recommend that you use dCopy. Indeed:
Copies an image:
  • from an Image control into another Image control.
  • Versions 17 and later
    WEBDEV - Server codeWindows in an Image variable.
    New in version 17
    WEBDEV - Server codeWindows in an Image variable.
    WEBDEV - Server codeWindows in an Image variable.
    in an Image variable.
    WEBDEV - Browser codePHP This type of variable is not available.
Versions 16 and later
WEBDEV - Browser code This function is now available in Browser code.
New in version 16
WEBDEV - Browser code This function is now available in Browser code.
WEBDEV - Browser code This function is now available in Browser code.
// 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 perform a screen shot, use the copyScreen constant: the entire screen content is copied.
WEBDEV - Server codeWEBDEV - Browser code The copyScreen constant is not available. The image to copy must necessarily be found in an Image control and it must be a generated image.
<Destination Image control>: Control name
Name of destination Image control where the copy will be performed.
WEBDEV - Server codeWEBDEV - Browser code The destination Image control must contain a generated image.
<Copy mode>: Optional constant
Mode of copy to perform.
copyDstInvertReverses the colors of destination Image control.
copyImageCombines 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.
copyMergeCopyMerges the source Image control and the destination Image control.
copyMergePaintCombines, via the "Logical AND" method, the source Image control and the "pattern" of destination Image control.
copyPatCopyCopies the "pattern" of source Image control into the destination Image control.
copyPatInvertCombines, 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.
copyPatPaintCombines, via the "Or" method, the inverted source Image control and the "pattern" of destination Image control.
copyNotSrcCopyReverses the colors of source Image control.
copyNotSrcEraseReverses, 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).
copySrcEraseReverses the destination Image control and combines the result with the copy of source Image control.
copySrcAndCombines, via the "and" method, the pixels of the Image image control and the pixels of destination Image control.
copySrcInvertCombines, via the "Exclusive Or" method, the pixels of the source Image control and the pixels of the destination Image control.
copySrcPaintCombines, via the "Or" method, the pixels of source Image control and the pixels of destination Image control.
copyWhitenessFills the destination Image control with white.
copyBlacknessFills 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.
Versions 17 and later
WEBDEV - Server code

Copying the images found in the Image variables Hide the details

<Result> = dCopyBlt(<Name of source image> , <Name of destination image> [, <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.
<Name of source image>: Image variable
Name of the Image variable to use. This image is the source image.
<Name of destination image>: Image variable
Name of the Image variable into which the copy will be performed.
<X source image>: Optional integer
X coordinate (in pixels) of top left corner of the area to copy (top left corner of source image 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 by default).
<Height source image>: Optional integer
Height (in pixels) of the area to copy (height of source image by default).
<Width source image>: Optional integer
Width (in pixels) of the area to copy (width of source image 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 by default).
<Y destination image>: Optional integer
Y coordinate (in pixels) of the top left corner of destination area for the copy (top left corner of destination image by default).
<Height destination image>: Optional integer
Height (in pixels) of the area into which the image will be copied (height of destination image 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 into which the image will be copied (width of destination image by default). If this width is greater than the width of source image, the image will be enlarged during the copy.
WEBDEV - Server code

Copying the images found in the Image variables Hide the details

<Result> = dCopyBlt(<Name of source image> , <Name of destination image> [, <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.
<Name of source image>: Image variable
Name of the Image variable to use. This image is the source image.
<Name of destination image>: Image variable
Name of the Image variable into which the copy will be performed.
<X source image>: Optional integer
X coordinate (in pixels) of top left corner of the area to copy (top left corner of source image 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 by default).
<Height source image>: Optional integer
Height (in pixels) of the area to copy (height of source image by default).
<Width source image>: Optional integer
Width (in pixels) of the area to copy (width of source image 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 by default).
<Y destination image>: Optional integer
Y coordinate (in pixels) of the top left corner of destination area for the copy (top left corner of destination image by default).
<Height destination image>: Optional integer
Height (in pixels) of the area into which the image will be copied (height of destination image 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 into which the image will be copied (width of destination image by default). If this width is greater than the width of source image, the image will be enlarged during the copy.
New in version 17
WEBDEV - Server code

Copying the images found in the Image variables Hide the details

<Result> = dCopyBlt(<Name of source image> , <Name of destination image> [, <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.
<Name of source image>: Image variable
Name of the Image variable to use. This image is the source image.
<Name of destination image>: Image variable
Name of the Image variable into which the copy will be performed.
<X source image>: Optional integer
X coordinate (in pixels) of top left corner of the area to copy (top left corner of source image 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 by default).
<Height source image>: Optional integer
Height (in pixels) of the area to copy (height of source image by default).
<Width source image>: Optional integer
Width (in pixels) of the area to copy (width of source image 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 by default).
<Y destination image>: Optional integer
Y coordinate (in pixels) of the top left corner of destination area for the copy (top left corner of destination image by default).
<Height destination image>: Optional integer
Height (in pixels) of the area into which the image will be copied (height of destination image 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 into which the image will be copied (width of destination image by default). If this width is greater than the width of source image, the image will be enlarged during the copy.
WEBDEV - Server code

Copying the images found in the Image variables Hide the details

<Result> = dCopyBlt(<Name of source image> , <Name of destination image> [, <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.
<Name of source image>: Image variable
Name of the Image variable to use. This image is the source image.
<Name of destination image>: Image variable
Name of the Image variable into which the copy will be performed.
<X source image>: Optional integer
X coordinate (in pixels) of top left corner of the area to copy (top left corner of source image 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 by default).
<Height source image>: Optional integer
Height (in pixels) of the area to copy (height of source image by default).
<Width source image>: Optional integer
Width (in pixels) of the area to copy (width of source image 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 by default).
<Y destination image>: Optional integer
Y coordinate (in pixels) of the top left corner of destination area for the copy (top left corner of destination image by default).
<Height destination image>: Optional integer
Height (in pixels) of the area into which the image will be copied (height of destination image 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 into which the image will be copied (width of destination image by default). If this width is greater than the width of source image, the image will be enlarged during the copy.
WEBDEV - Server code

Copying the images found in the Image variables Hide the details

<Result> = dCopyBlt(<Name of source image> , <Name of destination image> [, <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.
<Name of source image>: Image variable
Name of the Image variable to use. This image is the source image.
<Name of destination image>: Image variable
Name of the Image variable into which the copy will be performed.
<X source image>: Optional integer
X coordinate (in pixels) of top left corner of the area to copy (top left corner of source image 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 by default).
<Height source image>: Optional integer
Height (in pixels) of the area to copy (height of source image by default).
<Width source image>: Optional integer
Width (in pixels) of the area to copy (width of source image 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 by default).
<Y destination image>: Optional integer
Y coordinate (in pixels) of the top left corner of destination area for the copy (top left corner of destination image by default).
<Height destination image>: Optional integer
Height (in pixels) of the area into which the image will be copied (height of destination image 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 into which the image will be copied (width of destination image by default). If this width is greater than the width of source image, the image will be enlarged during the copy.
WEBDEV - Server code

Copying the images found in the Image variables Hide the details

<Result> = dCopyBlt(<Name of source image> , <Name of destination image> [, <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.
<Name of source image>: Image variable
Name of the Image variable to use. This image is the source image.
<Name of destination image>: Image variable
Name of the Image variable into which the copy will be performed.
<X source image>: Optional integer
X coordinate (in pixels) of top left corner of the area to copy (top left corner of source image 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 by default).
<Height source image>: Optional integer
Height (in pixels) of the area to copy (height of source image by default).
<Width source image>: Optional integer
Width (in pixels) of the area to copy (width of source image 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 by default).
<Y destination image>: Optional integer
Y coordinate (in pixels) of the top left corner of destination area for the copy (top left corner of destination image by default).
<Height destination image>: Optional integer
Height (in pixels) of the area into which the image will be copied (height of destination image 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 into which the image will be copied (width of destination image by default). If this width is greater than the width of source image, the image will be enlarged during the copy.
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 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.
area to zoom in
zoomed area
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)
PHP

Drawing in PHP

In PHP, the drawing functions are based on the graphic library GD. This library is commonly used by the PHP hosting companies and therefore it is always enabled. The version of the GD library must be version 2.0.28 (or later). This library can be downloaded from the PHP site.
To enable (if necessary) this library locally, the following elements are required:
  • PHP installed.
  • the PHP.INI file found in the Windows directory must contain the following line: "extension=php_gd2.dll" (instead of ";extension=php_gd2.dll").
  • the php_gd2.dll file must exist in the directory of PHP extensions. This directory is defined in the PHP.INI file by the "extension_dir" variable.
Versions 16 and later
WEBDEV - Browser code

Drawing in Browser code

Some drawing functions are available in Browser code. The drawing functions in Browser code are based on the HTML 5 standard. More specifically, these functions are based on the "canvas" tag of HTML 5.
The drawing features in browser code are available for the recent browsers only (supporting the HTML 5 standard). To find out whether the drawing features are proposed by your browser, use DrawingAvailable.
Caution: To use the drawing functions with Internet Explorer 9, the project must "include the reference to the DTD file". This option is available in the "Advanced" tab of description window of project ("Project .. Project description"), "Advanced" button, "W3C standard" option.
Caution: To use the drawing functions with Internet Explorer 9, the project must "include the reference to the DTD file". This option is available in the "Advanced" tab of the description window of the project ("Project .. Project description").
Caution: To use the drawing functions with Internet Explorer 9, the project must include the reference to the DTD file. To do so, the HTML mode must be "HTML 4.01 Transitional + DTD". This option is available in the "Advanced" tab of the description window of project.
Reminder: To display the description window of project, on the "Project" pane, in the "Project" group, click "Description".
Special case: Drawing in the browser of an Android phone: The browser drawing functions are only available starting with version 3 of Android.
New in version 16
WEBDEV - Browser code

Drawing in Browser code

Some drawing functions are available in Browser code. The drawing functions in Browser code are based on the HTML 5 standard. More specifically, these functions are based on the "canvas" tag of HTML 5.
The drawing features in browser code are available for the recent browsers only (supporting the HTML 5 standard). To find out whether the drawing features are proposed by your browser, use DrawingAvailable.
Caution: To use the drawing functions with Internet Explorer 9, the project must "include the reference to the DTD file". This option is available in the "Advanced" tab of description window of project ("Project .. Project description"), "Advanced" button, "W3C standard" option.
Caution: To use the drawing functions with Internet Explorer 9, the project must "include the reference to the DTD file". This option is available in the "Advanced" tab of the description window of the project ("Project .. Project description").
Caution: To use the drawing functions with Internet Explorer 9, the project must include the reference to the DTD file. To do so, the HTML mode must be "HTML 4.01 Transitional + DTD". This option is available in the "Advanced" tab of the description window of project.
Reminder: To display the description window of project, on the "Project" pane, in the "Project" group, click "Description".
Special case: Drawing in the browser of an Android phone: The browser drawing functions are only available starting with version 3 of Android.
WEBDEV - Browser code

Drawing in Browser code

Some drawing functions are available in Browser code. The drawing functions in Browser code are based on the HTML 5 standard. More specifically, these functions are based on the "canvas" tag of HTML 5.
The drawing features in browser code are available for the recent browsers only (supporting the HTML 5 standard). To find out whether the drawing features are proposed by your browser, use DrawingAvailable.
Caution: To use the drawing functions with Internet Explorer 9, the project must "include the reference to the DTD file". This option is available in the "Advanced" tab of description window of project ("Project .. Project description"), "Advanced" button, "W3C standard" option.
Caution: To use the drawing functions with Internet Explorer 9, the project must "include the reference to the DTD file". This option is available in the "Advanced" tab of the description window of the project ("Project .. Project description").
Caution: To use the drawing functions with Internet Explorer 9, the project must include the reference to the DTD file. To do so, the HTML mode must be "HTML 4.01 Transitional + DTD". This option is available in the "Advanced" tab of the description window of project.
Reminder: To display the description window of project, on the "Project" pane, in the "Project" group, click "Description".
Special case: Drawing in the browser of an Android phone: The browser drawing functions are only available starting with version 3 of Android.
Component : wd170obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment