PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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.
Note: See Declaring a variable for more details.
Caution: This documentation presents the last features of the Word Processing control. Make sure that all the necessary modules are updated.
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
ImageBufferImageImage buffer.
WrappingInteger constantType of wrapping for the image:
  • 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).
HeightRealHeight of 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 height from pixels to millimeters.
WidthRealWidth of 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.
XRealX position of image in relation to its anchoring point (in millimeters).
This property is only used for the images for which ..Wrapping differs from the docWrappingAlignedOnText constant.
YRealY position of image in relation to its anchoring point (in millimeters).
This property is only used for the images for which ..Wrapping differs from the docWrappingAlignedOnText constant.

Note: These properties can be handled by using one of the following syntaxes:
  • <Variable Name>..<Property Name>
  • <Variable Name>.<Property Name>
Minimum required version
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment