ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / Drawing functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
dLoadImage (Function)
In french: dChargeImage
Loads an image in an Image variable from a memo, a file or a binary buffer (buffer containing the full data of a recognized image file).
Example
// Chargement d'une image à partir d'un fichier dans le répertoire de l'exécutable
MonImage is Image
MonImage = dLoadImage("image.png")
sNomFichierPDF is string = fDataDir() + fSep() +"MonFichier.pdf"
// Chargement d'une image vectorielle (ici un PDF, cela pourrait être un SVG)
// Récupération des caractéristiques de l'image
sInfoPDF is string = ImageInfo(sNomFichierPDF)
// Les images vectorielles sont transformées en images bitmap (raster, donc non vectorielles)
// On  définit la résolution à laquelle on désire cette image
nDpiVoulu is int = 300
let nLargeurPixel = Val(ExtractString(sInfoPDF, 2)) * nDpiVoulu / 96 
let nHauteurPixel = Val(ExtractString(sInfoPDF, 3)) * nDpiVoulu / 96
// (Divisé par 96 car c'est la résolution utilisée
// pour donner la taille d'une image vectorielle par la fonction infoImage)
// Charge l'image à l'écran dans un champ Image avec la taille correspondant au DPI voulu
IMG_PDF = dLoadImage(sNomFichierPDF, imgConvert, nLargeurPixel, nHauteurPixel)
// Ou si l'image n'est pas affichée, utilisation d'une variable Image :
MonImage is Image = dLoadImage(sNomFichierPDF, imgConvert, nLargeurPixel, nHauteurPixel)
Syntax
<Result> = dLoadImage(<Image> [, <Options> [, <Width> [, <Height>]]])
<Result>: Image variable
Name of the Image variable into which the image must be loaded.
<Image>: Character string
Image to load. This image can correspond to:
  • the full path of the image file,
  • the name of an image file (if the image file is located in the executable directory),
  • a binary memo item in a data file,
  • a binary buffer containing the full data of a recognized image file (result of a function for saving images such as dSaveImagePNG).
<Options>: Optional Integer constant
Options for loading the image:
imgConvertConvert an image from the 8-bit format to the 24-bit format. This option is used to apply the effect algorithms to this image for example. This constant can be used for the images corresponding to PDF files for example.
For the vectorial images (SVG), this constant is mandatory. It is used to specify that the image must be converted into bitmap image (raster) before it is loaded (indeed, the Image type does not support the vectorial images).
imgDefault
(Default value)
Load the image as it is.
<Width>: Optional integer
Requested destination width (vectorial image only). This width is expressed in pixels.
<Height>: Optional integer
Requested destination height (vectorial image only). This height is expressed in pixels.
Component: wd300pnt.dll
Minimum version required
  • Version 17
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help