PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Properties specific to the description of Image variables
  • Accessing the pixels
  • Managing the Alpha layer
  • Image variable and Image control
  • Image variable and debugger
  • Creating an image with a specific size
  • Functions that handle the Image variables
  • Functions (prefixed syntax) that handle Image variables
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
The Image type is used to define the advanced characteristics of an image. The characteristics of this image can be defined and modified by several WLanguage properties.
Remark: See Declaring a variable for more details on the declaration of this type of variable and the use of WLanguage properties.
Versions 18 and later
Java This type of variable is now available for Java applications.
Universal Windows 10 App This type of variable is now available in Windows Store apps mode.
New in version 18
Java This type of variable is now available for Java applications.
Universal Windows 10 App This type of variable is now available in Windows Store apps mode.
Java This type of variable is now available for Java applications.
Universal Windows 10 App This type of variable is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This type of variable is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This type of variable is now available in Universal Windows 10 App mode.
Universal Windows 10 App This type of variable is now available in Universal Windows 10 App mode.
Example
MyImage is Image
// Load from a file
MyImage = dLoadImage("image.png")
// Equivalent syntaxes
// MyImage = "image.png"
// MyImage..Image = "image.png"

// Draw in the image
dStartDrawing(MyImage)

// Write a text
dFont("Arial", 12, iNormal, 0)
dText(4, 0, "I am writing my text in an Image control!")

// Resize
dResize(MyImage, 100, 100)

// End of drawing
dEndDrawing(MyImage)

// Assign to an Image control
IMG_ImageControl = MyImage
Remarks

Properties specific to the description of Image variables

The following properties can be used to handle an Image variable:
Property nameType usedEffect
WithAlphaBooleanUsed to find out whether the image contains an alpha layer:
  • True if the image contains an alpha layer,
  • False otherwise.
This property is available in read-only.
BitPerPixelIntegerNumber of bits per pixel.
This property is available in read-only.
FillColorColor variableFill color of the image. This color is used:
  • when resizing the image (..Height and ..Width)
  • when turning the image around (dRotation).
Versions 21 and later
DrawingScale
New in version 21
DrawingScale
DrawingScale
RealScale that will be used for the drawing functions (dXXX functions): the coordinates used by these functions will be multiplied by this value.
Java This property is not available.
EXIF[Exif tag]Associative arrayUsed to find out the content of the specified Exif tag.
..Empty is used to find out whether the content of the Exif tag is empty or not. For example:
IF not MyImage..EXIF[320]..Empty THEN
IsTagValue = MyImage..EXIF[320]
END
The Exif Tags that can be used are the ones listed in the documentation of ImageInfoValue.
This property is available in read-only.
Java This property is not available.
HeightIntegerHeight of image in pixels.
If this property is modified, the image is not deformed: additional pixels are added. The color of these pixels is defined by ..FillColor.
ImageAll typesUsed to load an image from a buffer, a file or a memo. This property is equivalent to dLoadImage.
Remarks:
  • In read mode, this property returns a buffer containing the image in PNG format.
  • The images in SVG or PDF format are not supported. To manage these formats, you must use dLoadImage.
  • The animated images are not supported.
  • A single page of multi-page images (TIF, ICO) can be loaded. Only the first page is loaded.
  • Versions 19 and later
    You have the ability to draw a chart in an Image variable via grDestinationImage.
    New in version 19
    You have the ability to draw a chart in an Image variable via grDestinationImage.
    You have the ability to draw a chart in an Image variable via grDestinationImage.
WidthIntegerWidth of image in pixels.
If this property is modified, the image is not deformed: additional pixels are added. The color of these pixels is defined by ..FillColor.
Pixel[x,y]Array of ColorUsed to handle the pixels of the image.
ValidateBooleanReturns the validity of the image:
  • True if the image is valid: it was successfully loaded or created.
  • False otherwise.
This property is available in read-only.

Remark: These properties can be used with one of the following syntaxes:
  • <Variable name>..<Property name>
  • <Variable name>.<Property name>

Accessing the pixels

To access the pixels of the image, you have the ability to use the following syntax:
<Name of Image Variable>[<Horizontal Coordinate>, <Vertical Coordinate>]
The origin of the coordinates is (0,0).
For example:
// Modify the pixel at coordinates 220,300
MyImage[220,300] = LightYellow
You also have the ability to use the Color properties. For example:
MyImage[220,300]..Lightness = MyImage[220,300]..Lightness + 10

Managing the Alpha layer

An image contains an Alpha layer in the following cases:
  • if it was created by default with an alpha layer, specified by ..FillColor.
  • if it was loaded from an image format containing an alpha layer (PNG format for example).
You also have the ability to handle the Alpha layer of the image by handling its pixels.

Image variable and Image control

You can:
  • assign an Image variable to an Image control.
  • assign an Image control to an Image variable.
These operations are available for the Image controls found in the window editor, page editor and report editor.

Image variable and debugger

The content of an Image variable can be viewed in the debugger.

Creating an image with a specific size

To create an image with a specific size, all you have to do is use ..Width and ..Height.
For example:
MyImage is Image
MyImage..Width = 10
MyImage..Height = 10
The unit used is the pixel.
The following code creates an image of 0 x 0.
MyImage is Image

Functions that handle the Image variables

Versions 09 and later
dArc
New in version 09
dArc
dArc
Draws an arc of circle or an arc of ellipse:
  • in an Image control,
  • in an Image variable.
Versions 09 and later
dBackground
New in version 09
dBackground
dBackground
Declares the default background color for the rectangles, circles, ... used:
  • in an Image control,
  • in an Image variable].
Versions 21 and later
dBorder
New in version 21
dBorder
dBorder
Draws a border.
Versions 09 and later
dChangeMode
New in version 09
dChangeMode
dChangeMode
Changes the drawing mode used by the drawing functions (dLine, dRectangle, ....).
Versions 09 and later
dChord
New in version 09
dChord
dChord
Draws the chord of a circle (intersection between an ellipse and a straight line):
  • in an Image control,
  • in an Image variable].
Versions 09 and later
dCircle
New in version 09
dCircle
dCircle
Draws a circle or an ellipse:
  • in an Image control,
  • in an Image variable,
  • in a WDPic variable (on the background layer),
  • in a picLayer variable.
Versions 18 and later
dCopy
New in version 18
dCopy
dCopy
Copies an image into another image.
Versions 09 and later
dCopyBlt
New in version 09
dCopyBlt
dCopyBlt
Copies an image:
  • from an Image control into another Image control.
  • from an Image variable into another Image variable.
Versions 17 and later
dCopyScreenImage
New in version 17
dCopyScreenImage
dCopyScreenImage
Copies the screen content into an Image variable or into an Image control.
Versions 17 and later
dCopyWindowImage
New in version 17
dCopyWindowImage
dCopyWindowImage
Copies the image from a WINDEV window into an Image variable or into an Image control.
Versions 17 and later
dCrop
New in version 17
dCrop
dCrop
Returns the cropped part of an image. This image is found in an Image variable.
Versions 17 and later
dEncrustColor
New in version 17
dEncrustColor
dEncrustColor
Encrusts a color in an image found in an Image variable].
Versions 09 and later
dFill
New in version 09
dFill
dFill
Colors an area:
  • in an Image control,
  • in an Image variable].
Versions 09 and later
dFont
New in version 09
dFont
dFont
Declares the font that will be used by dText:
  • in an Image control,
  • in an Image variable.
Versions 17 and later
dHalo
New in version 17
dHalo
dHalo
Adds a halo effect on an image found in an Image variable].
Versions 09 and later
dLine
New in version 09
dLine
dLine
Draws a line:
  • in an Image control,
  • in an Image variable].
Versions 17 and later
dLoadImage
New in version 17
dLoadImage
dLoadImage
Loads an image in an Image variable from a memo, a file or a binary buffer.
Versions 09 and later
dPen
New in version 09
dPen
dPen
Declares the default color and style for the lines, rectangles, circles, ... found:
  • in an Image control,
  • in an Image variable].
Versions 09 and later
dPoint
New in version 09
dPoint
dPoint
Draws a point:
  • in an Image control,
  • in an Image variable].
Versions 09 and later
dPolygon
New in version 09
dPolygon
dPolygon
Draws a polygon:
  • in an Image control,
  • in an Image variable.
Versions 24 and later
dPolyline
New in version 24
dPolyline
dPolyline
Draws a line composed of several segments.
Versions 09 and later
dRectangle
New in version 09
dRectangle
dRectangle
Draws a rectangle:
  • in an Image control,
  • in an Image variable].
Versions 12 and later
dRectangleGradient
New in version 12
dRectangleGradient
dRectangleGradient
Draws a rectangle:
  • in an Image control,
  • in an Image variable].
Versions 21 and later
dRoundedRectangle
New in version 21
dRoundedRectangle
dRoundedRectangle
Draws a rounded rectangle:
  • in an Image control,
  • in an Image variable.
Versions 17 and later
dShadow
New in version 17
dShadow
dShadow
Adds a shadow effect on an image found in an Image variable].
Versions 09 and later
dSlice
New in version 09
dSlice
dSlice
Draws a circle section or an ellipse section:
  • in an Image control,
  • in an Image variable].
Versions 09 and later
dText
New in version 09
dText
dText
Draws a text:
  • in an Image control,
  • in an Image variable].
Versions 20 and later
dTextRTF
New in version 20
dTextRTF
dTextRTF
Draws an RTF text:
  • in an Image control,
  • in an Image variable].
Versions 17 and later
dTransferToImage
New in version 17
dTransferToImage
dTransferToImage
Creates an image from a buffer of pixels encoded in a specific format.
This function is an advanced function. This function is mainly used to handle the images returned by external APIs via Image variables.
Versions 19 and later
grDestinationImage
New in version 19
grDestinationImage
grDestinationImage
Defines an Image variable as destination of a chart.
Versions 09 and later
iImageHeight
New in version 09
iImageHeight
iImageHeight
Calculates the height of the image to print (in millimeters).
Versions 09 and later
iImageWidth
New in version 09
iImageWidth
iImageWidth
Calculates the width of the image to print (in millimeters).
Versions 09 and later
iPrintImage
New in version 09
iPrintImage
iPrintImage
Sends the image file to print to the print buffer.

Functions (prefixed syntax) that handle Image variables

Versions 24 and later
<Image variable>.Background
<Image variable>.Background
Declares the default background color for the rectangles, circles, ... used in an Image variable.
Versions 24 and later
<Image variable>.ChangeMode
<Image variable>.ChangeMode
Changes the drawing mode used by the drawing functions (dLine, dRectangle, ....).
Versions 24 and later
<Image variable>.Copy
New in version 24
<Image variable>.Copy
<Image variable>.Copy
Copies an image into another image.
Versions 24 and later
<Image variable>.Crop
New in version 24
<Image variable>.Crop
<Image variable>.Crop
Returns the cropped part of an image. This image is found in an Image variable.
<Image variable>.DominantImageColorReturns the dominant color (i.e. most frequent color) of an image found in an Image variable.
Versions 24 and later
<Image variable>.DrawArc
New in version 24
<Image variable>.DrawArc
<Image variable>.DrawArc
Draws a circle arc on an ellipse arc in an Image variable.
Versions 24 and later
<Image variable>.DrawBorder
<Image variable>.DrawBorder
Draws a border in an Image variable.
Versions 24 and later
<Image variable>.DrawChord
<Image variable>.DrawChord
Draws the chord of a circle (intersection between an ellipse and a straight line) in an Image variable.
Versions 24 and later
<Image variable>.DrawCircle
<Image variable>.DrawCircle
Draws a circle or an ellipse in an Image variable.
Versions 24 and later
<Image variable>.DrawHalo
New in version 24
<Image variable>.DrawHalo
<Image variable>.DrawHalo
Adds a halo effect on an image found in an Image variable].
Versions 24 and later
<Image variable>.DrawLine
New in version 24
<Image variable>.DrawLine
<Image variable>.DrawLine
Draws a line in an Image variable.
Versions 24 and later
<Image variable>.DrawPoint
<Image variable>.DrawPoint
Draws a point in an Image variable.
Versions 24 and later
<Image variable>.DrawPolygon
<Image variable>.DrawPolygon
Draws a polygon in an Image variable.
Versions 24 and later
<Image variable>.DrawPolyline
<Image variable>.DrawPolyline
Draws a line composed of several segments in an Image variable.
Versions 24 and later
<Image variable>.DrawRectangle
<Image variable>.DrawRectangle
Draws a rectangle in an Image variable.
<Image variable>.DrawRectangleGradientDraws a rectangle in an Image variable.
<Image variable>.DrawRoundedRectangleDraws a rounded rectangle in an Image variable.
Versions 24 and later
<Image variable>.DrawShadow
<Image variable>.DrawShadow
Adds a shadow effect on an image found in an Image variable].
Versions 24 and later
<Image variable>.DrawSlice
<Image variable>.DrawSlice
Draws a section of a circle or an ellipse in an Image variable.
Versions 24 and later
<Image variable>.DrawText
New in version 24
<Image variable>.DrawText
<Image variable>.DrawText
Draws a text in an Image variable.
Versions 24 and later
<Image variable>.DrawTextRTF
<Image variable>.DrawTextRTF
Draws an RTF text in an Image variable.
Versions 24 and later
<Image variable>.EncrustColor
<Image variable>.EncrustColor
Encrusts a color in an image found in an Image variable].
Versions 24 and later
<Image variable>.Fill
New in version 24
<Image variable>.Fill
<Image variable>.Fill
Colors an area in an Image variable.
Versions 24 and later
<Image variable>.Font
New in version 24
<Image variable>.Font
<Image variable>.Font
Declares the font that will be used by dText in an Image variable Image.
<Image variable>.HorizontalSymmetryPerforms a horizontal symmetry of an image in an Image variable.
Versions 24 and later
<Image variable>.InvertColor
<Image variable>.InvertColor
Inverts the colors in an Image variable.
Versions 24 and later
<Image variable>.ModifyHSL
<Image variable>.ModifyHSL
Modifies the hue, saturation and lightness of an image in an Image variable.
Versions 24 and later
<Image variable>.ModifyHue
<Image variable>.ModifyHue
Modifies the hue of an image found in an Image variable.
<Image variable>.ModifyLightnessModifies the lightness of an image in an Image variable.
Versions 24 and later
<Image variable>.ModifyOpacity
<Image variable>.ModifyOpacity
Modifies the opacity of an image (which means the alpha layer of the image).
<Image variable>.ModifySaturationModifies the saturation of an image in an Image variable.
Versions 24 and later
<Image variable>.Pen
New in version 24
<Image variable>.Pen
<Image variable>.Pen
Declares the default color and style for the lines, rectangles, circles, ... found in an Image variable.
Versions 24 and later
<Image variable>.PixelColor
<Image variable>.PixelColor
Identifies the color of a pixel contained in an Image variable.
Versions 24 and later
<Image variable>.PixelOpacity
<Image variable>.PixelOpacity
Identifies the opacity of a pixel in an image (in an Image variable) that manages the Alpha layer.
Versions 24 and later
<Image variable>.Resize
New in version 24
<Image variable>.Resize
<Image variable>.Resize
Resizes an image in an Image variable.
Versions 24 and later
<Image variable>.Rotation
New in version 24
<Image variable>.Rotation
<Image variable>.Rotation
Rotates an image in an Image variable.
Versions 24 and later
<Image variable>.SaveBMP
New in version 24
<Image variable>.SaveBMP
<Image variable>.SaveBMP
Saves an image contained in an Image variable:
  • in a file in BMP format.
  • in memory.
Versions 24 and later
<Image variable>.SaveGIF
New in version 24
<Image variable>.SaveGIF
<Image variable>.SaveGIF
Saves an image found in an Image variable:
  • in a file in GIF format.
  • in memory.
Versions 24 and later
<Image variable>.SaveJPEG
New in version 24
<Image variable>.SaveJPEG
<Image variable>.SaveJPEG
Saves an image found in an Image variable:
  • in a file in JPEG format.
  • in memory.
Versions 24 and later
<Image variable>.SavePNG
New in version 24
<Image variable>.SavePNG
<Image variable>.SavePNG
Saves an image found in an Image variable:
  • in a file in PNG format.
  • in memory.
Versions 24 and later
<Image variable>.StartDrawing
<Image variable>.StartDrawing
Indicates that the drawing functions that will be used are intended for an Image variable.
<Image variable>.VerticalSymmetryPerforms a vertical symmetry of an image in an Image variable.
Minimum version required
  • Version 17
This page is also available for…
Comments
 image clip vidéo
https://youtu.be/A3x_45AOsPE

// image clip vidéo

// recortar imagen
amarildo
06 Jan. 2019