ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Word Processing functions / Types of variables
  • Properties specific to the description of docElementImage 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 docElementImage type is used to handle the characteristics of an Image element found in a docElement variable.
The characteristics of docElementImage variable can be handled by several WLanguage properties.
CAUTION: This type cannot be used directly. It must be used via the docElement type.
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
// Inserts an image cursor location
// Select the image file
sFile is string
sFile = fImageSelect(fCurrentDir(), "", ...
"Insert an image","JPEG (*.JPG)" + TAB + "*.jpg" + CR + ...
"PNG (*.PNG)" + TAB + "*.png" + CR + "All files (*.*)" + TAB + "*.*")
 
IF sFile = "" THEN
RETURN
END
 
// The image file is transferred into an Image variable
img is Image
img = sFile
 
// Declare an Image element (that will be inserted into the document)
elt is docElement
elt.Type = typeDocElementImage
elt.Image.BufferImage = img
elt.Image.Wrapping = docWrappingAlignedOnText
 
 
// Calculate the width and height of the image found in the element
// The image size is expressed in pixels in the Image variable.
// This size is converted into mm in the element (unit used in a document)
elt.Image.Width = img.Width * 25.4 / 96.0
elt.Image.Height = img.Height * 25.4 / 96.0
// Image position
elt.Image.X = 0
elt.Image.Y = 0
 
DocInsert(WP_MyDocument, WP_MyDocument.Cursor, elt)
Remarks

Properties specific to the description of docElementImage variables

The following properties can be used to handle a docElementImage variable:
Property nameType usedEffect
HeightRealImage height in millimeters.
Caution: the unit used is the millimeter instead of the pixel (not enough precision). Don't forget to convert (if necessary) the image height from pixels to millimeters.
ImageBufferImageImage buffer.
ImageLinkCharacter stringLink to the Image file. The actual image will not be integrated into the document, but only a link to the image.
WidthRealWidth of the image in millimeters.
Caution: the unit used is the millimeter instead of the pixel (not enough precision). Don't forget to convert (if necessary) the image width from pixels to millimeters.
WrappingInteger constantType of image wrapping:
  • docWrappingAlignedOnText: The image inserted into the line and it is linked to the text location where it was inserted. It is processed like any character. It moves with the text.
  • docWrappingThrough: Used to customize the wrapping.
  • docWrappingBehindTheText: Allows you to use the image in watermark behind the text.
  • docWrappingBeforeTheText: Used to display the image above the text.
  • docWrappingFramed: Wraps the text around the image border (recommended for a square image).
  • docWrappingTopAndBottom: The image remains on its line and it is located between two text sections at the top and at the bottom.
  • docWrappingNear: Wraps the image according to its outlines (recommended for a round image or for an image with an irregular shape).
XRealX-position of the image in relation to its anchoring point (in millimeters).
This property is used only for images for which the Wrapping property is set to a constant other than docWrappingAlignedOnText.
YRealY-position of the image in relation to its anchoring point (in millimeters).
This property is used only for images for which the Wrapping property is set to a constant other than docWrappingAlignedOnText.
ZOrderIntegerNumber corresponding to the Z-order of the image.
This property is automatically modified when DocChangeZOrder is used.
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/01/2022

Send a report | Local help