PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
New WINDEV, WEBDEV, WINDEV Mobile 24 feature!
  • Coordinates
  • Drawing in an Image control with opacity
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
Identifies the opacity of a pixel in an image (in an Image variable) that manages the Alpha layer.
Example
MyImage is Image = "Test.gif"
// Identify the opacity of the pixel (15, 25)
// on the "IMG_ImageDrawing" control
ResOpacity = MyImage.PixelOpacity(15, 25)
IMG_MyDrawing = MyImage
 
Syntax
<Result> = <Image variable>.PixelOpacity(<X coordinate> , <Y coordinate>)
<Result>: Integer
Opacity of specified pixel (included between 0 for transparent and 255 for opaque).
<Image variable>: Image variable
Name of Image variable to use.
<X coordinate>: Integer
Horizontal position of pixel to use.
<Y coordinate>: Integer
Vertical position of pixel to use.
Remarks

Coordinates

The coordinates are specified in pixels in relation to the top left corner of Image control (coordinates set to (0, 0)).
To retrieve the position of a mouse click in an Image control, use MouseXPos and MouseYPos.

Drawing in an Image control with opacity

<Image variable>.StartDrawing must be called before using the drawing functions. <Image variable>.StartDrawing is used to define the image (Image control or Image variable) onto which the drawing functions will be applied. The dWithOpacity constant is used to specify that the opacity will be managed by the drawing (Alpha layer).
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 Windows functions must use the DC (Device Context) returned by <Image variable>.StartDrawing.
For an Image control, <Image variable>.EndDrawing and <Image variable>.StartDrawing must not be called in the same process. The drawing will not be displayed if <Image variable>.EndDrawing and <Image variable>.StartDrawing are called in the same process: it will be automatically erased.
Component : wd240obj.dll
Minimum required version
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment