PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Zoom on an image
  • Using the drawing functions
  • Various
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
Copies an image into another image.
This copy can be performed:
  • between Image controls.
  • between Image variables.
  • between an Image control and an Image variable.
Versions 20 and later
PHP This function is now available for the PHP sites.
New in version 20
PHP This function is now available for the PHP sites.
PHP This function is now available for the PHP sites.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
StartZoomX is int = 0
StartZoomY is int = 0
ZoomHeight is int = 130
ZoomWidth is int = 90
dCopy(MAP_MyMap, IMG_Details, StartZoomX, StartZoomY, ZoomWidth, ZoomHeight)
Syntax
<Result> = dCopy(<Name of Source Image> , <Name of Destination Image> [, <X of Source Image> [, <Y of Source Image> [, <Width of Source Image> [, <Height of Source Image> [, <X of Destination Image> [, <Y of Destination Image> [, <Width of Destination Image> [, <Height of Destination Image>]]]]]]]])
<Result>: Boolean
  • True if the copy was performed,
  • False otherwise. For example, dCopy can return False:
    • if the screen driver does not support this function. In this case, a message is displayed in the copied image. We advise you to update the screen driver in order to get a standard operating mode.
    • if the destination image is not initialized (for example, the size of the image was not assigned by ..Height and ..Width).
<Name of Source Image>: Character string (with or without quotes)
  • Name of the source Image control to use.
  • Name of Image variable to use.
<Name of Destination Image>: Character string (with or without quotes)
  • Name of destination Image control where the copy will be performed.
  • Name of an Image variable where the copy must be performed.
<X of 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 of 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).
<Width of Source Image>: Optional integer
Width (in pixels) of the area to copy (width of source image by default).
<Height of Source Image>: Optional integer
Height (in pixels) of the area to copy (height of source image by default).
<X of 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 of 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).
<Width of 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.
<Height of 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.
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 <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:
dCopy(IMG_SourceControl, IMG_DestinationControl, 10, 10, 40, 30, 10, 10, 80, 60)

Using the drawing functions

  • dStartDrawing must be called before any other drawing function. dStartDrawing is used to define the element (Image control or Image variable) onto which the drawing functions will be applied.
  • When drawing on an Image control:
    • The drawing functions operate on a copy ("bitmap") of the image. You can use the drawing functions of Windows (via API or CallDLL32) but these functions must use the DC (Device Context) returned by dStartDrawing.
    • dEndDrawing and dStartDrawing must not be called in the same process.
      The drawing will not be displayed if dEndDrawing and dStartDrawing are called in the same process: it will be automatically erased.

Various

Caution: the <Height> and <Width> parameters are passed in a different order in dCopy> and in dCopyBlt.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230pnt.dll
Windows Mobile wp230pnt.dll
Java wd230java.jar
Linux wd230pnt.so
Android wd230android.jar
Minimum required version
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment