ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

  • Properties specific to picLayer variables
  • WLanguage functions that use picLayer variables
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
The picLayer type is used to define all the advanced characteristics of a layer of an image loaded in a WDPic variable. The characteristics of this layer can be defined and changed using different WLanguage properties.
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
// Open a source image
MyImage is WDPic
MyImage.FileName = fExeDir() + ["\"] + "Source.png"
 
// Add a layer containing a rectangle
RectangleLayer is picLayer
RectangleLayer.Name = "Rectangle"
RectangleLayer.Width = 100
RectangleLayer.Height = 100
dRectangle(RectangleLayer, 1, 1, 50, 50, DarkGreen, DarkBlue)
 
// Rotate layer
dRotation(RectangleLayer, 45, drAdapt)
 
RectangleLayer.X = nXLayer
RectangleLayer.Y = nYLayer
Add(MyImage.Layer, RectangleLayer)
 
 
// Save the result
PicSave(MyImage, fExeDir() + ["\"] + "Result.png")
Remarks

Properties specific to picLayer variables

The following properties can be used to handle a layer of a WDPic image:
Property nameType usedEffect
HeightIntegerLayer height expressed in pixels.
ImageImage associated with layer.
If this property is specified, the Type property will correspond to the typeLayerImage constant.
NameCharacter stringLayer name.
RTFpicRTF variableString in Rich Text Format.
TextpicText variableLayer text. The properties of the picText variable are used to find out and define the options of the text (font, opacity, alignment, etc.).
TypeInteger constantType of layer:
  • typeLayerImage: Image layer. The Image property gets and sets the image associated with the layer.
  • typeLayerRTF: RTF layer. The RTF property gets and sets the content of the layer.
  • typeLayerTexte: Text layer. The Text property gets and sets the text associated with the layer.
VisibleBoolean
  • True if the layer is visible,
  • False if the layer is invisible.
WidthIntegerLayer width expressed in pixels.
XIntegerHorizontal position of layer on the image, expressed in pixels.
YIntegerVertical position of layer on the image, expressed in pixels.

WLanguage functions that use picLayer variables

AlbumSaveSaves an image, a photo or a video in the photo album of the mobile device.
ClipboardRetrieves the text or image found in the system clipboard.
dAlphaBlendBlends two images together. This allows you to create fade-in effects between 2 images.
dArcDraws an arc of circle or an arc of ellipse:
  • in an Image control,
  • in an Image variable,
  • in a WDPic variable (on the background layer),
  • in a picLayer variable.
dBackgroundDeclares the default background color for the rectangles, circles, etc.::
  • in an Image control,
  • in an Image variable,
  • in a WDPic variable (on the background layer),
  • in a picLayer variable.
dBlurBlurs the entire given area:
  • in an Image control,
  • in an Image variable,
  • in a WDPic variable (on the background layer),
  • in a picLayer variable.
dBorderDraws the borders.
dChangeModeChanges the drawing mode used by the drawing functions (dLine, dRectangle, ....).
dChordDraws the chord of a circle (intersection between an ellipse and a straight line):
  • in an Image control,
  • in an Image variable,
  • in a WDPic variable (on the background layer),
  • in a picLayer variable.
dCircleDraws 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.
dCopyCopies an image to another image.
dCopyBltCopies an image:
  • from an Image control to another Image control.
  • from an Image variable to another Image variable.
dDominantImageColorReturns the dominant (i.e. most frequent) color of an image in an Image variable or in an Image control.
dEndDrawingDeletes all the drawings made since the last call to dStartDrawing.
dFillColors an area:
  • in an Image control,
  • in an Image variable,
  • in a WDPic variable (on the background layer),
  • in a picLayer variable.
dFontDeclares the font that will be used by dText:
  • in an Image control,
  • in an Image variable,
  • in a WDPic variable (on the background layer),
  • in a picLayer variable.
dHorizontalSymmetryFlips an image with respect to a horizontal axis (symmetry with respect to a horizontal axis).
dInvertColorInverts the colors:
  • in an Image control,
  • in an Image variable,
  • in a WDPic variable (on the background layer),
  • in a picLayer variable.
dLineDraws a line:
  • in an Image control,
  • in an Image variable,
  • in a WDPic variable (on the background layer),
  • in a picLayer variable.
dModifyHSLModifies the hue, the saturation and the lightness of an image found:
  • in an Image control,
  • in an Image variable.
dModifyHueChanges the hue of an image:
  • in an Image control,
  • in an Image variable.
dModifyLightnessChanges the lightness of an image found:
  • in an Image control,
  • in an Image variable.
dModifyOpacityModifies the opacity of an image (which means the alpha channel of the image).
dModifySaturationModifies the saturation of an image found:
  • in an Image control,
  • in an Image variable.
DocAddAdds:
  • at the end of a Word Processing document: an element, a document, a paragraph, a text, an image or a fragment.
  • at the end of a fragment: an element, a text or an image.
DocInsertInserts an object into a Word Processing document or replaces the content of the current fragment. The objects that can be used are:
  • an element,
  • a document,
  • a paragraph,
  • a text,
  • an image,
  • a fragment.
dPenDeclares the default color and style for the lines, rectangles, circles, ... found:
  • in an Image control,
  • in an Image variable,
  • in a WDPic variable (on the background layer),
  • in a picLayer variable.
dPixelColorIdentifies the color of a pixel:
dPixelOpacityIdentifies the opacity of a pixel in an image that has an Alpha channel. This image can be:
  • an Image control,
  • an Image variable,
  • a WDPic variable (on the background layer),
  • a picLayer variable.
dPointDraws a point:
  • in an Image control,
  • in an Image variable,
  • in a WDPic variable (on the background layer),
  • in a picLayer variable.
dPolygonDraws a polygon:
  • in an Image control,
  • in an Image variable,
  • in a WDPic variable (on the background layer),
  • in a picLayer variable.
dPolylineDraws a line composed of multiple segments.
dRectangleDraws a rectangle:
  • in an Image control,
  • in an Image variable,
  • in a WDPic variable (on the background layer),
  • in a picLayer variable.
dRectangleGradientDraws a rectangle:
  • in an Image control,
  • in an Image variable,
  • in a WDPic variable (on the background layer),
  • in a picLayer variable.
dResizeResizes an image:
  • in an Image control.
  • in an Image variable.
  • in a picLayer variable].
dRotationPerforms a rotation:
dRoundedRectangleDraws a rounded rectangle:
  • in an Image control,
  • in an Image variable,
  • in a WDPic variable (on the background layer),
  • in a picLayer variable.
dSaveImageBMPSaves an image:
  • in a file in BMP format.
  • in memory.
dSaveImageGIFSaves an image:
  • in a file in GIF format.
  • in memory.
dSaveImageJPEGSaves an image:
  • in a JPEG file.
  • in memory.
dSaveImagePNGSaves an image:
  • in a PNG file.
  • in memory.
dSliceDraws a circle section or an ellipse section:
  • in an Image control,
  • in an Image variable,
  • in a WDPic variable (on the background layer),
  • in a picLayer variable.
dStartDrawingIndicates that the drawing functions that will be used are intended for:
  • the specified Image control,
  • the specified Image variable,
  • the specified Image variable,
  • the specified WDPic variable (on the background layer),
  • the specified picLayer variable.
dTextDraws a text:
  • in an Image control,
  • in an Image variable,
  • in a WDPic variable (on the background layer),
  • in a picLayer variable.
dTextRTFDraws RTF text:
  • in an Image control,
  • in an Image variable.
dVerticalSymmetryFlips an image with respect to a vertical axis (symmetry with respect to a vertical axis).
grDestinationImageDefines an Image variable as destination of a chart.
iImageHeightCalculates the height of the image to print (in millimeters).
iImageWidthCalculates the width of the image to print (in millimeters).
iPrintImageSends the image file to print to the print buffer.
ToClipboardWrites text or image information into the system clipboard.
Related Examples:
WDPic type Unit examples (WINDEV): WDPic type
[ + ] This example shows how to use the WDPic WLanguage type.
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment