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
  • Miscellaneous
  • Drawing in PHP
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Warning
As of version 2025 Update 2, this function has been renamed ImageInfo.
Retrieves the characteristics of an image file or the characteristics of a PDF file:
  • format.
  • width and height.
  • number of bits per pixel.
  • WINDEVReports and QueriesAndroidiPhone/iPadJavaUser code (UMC) area of transparency.
  • WINDEVReports and QueriesAndroidiPhone/iPadJavaUser code (UMC) alpha channel.
AndroidAndroid Widget Java The PDF files are not supported.
New in version 2025
iPhone/iPad From version 2025 Update 2, this function is available for iPhone/iPad applications.
Linux Caution: In Linux, this function requires a specific configuration. For more details, see Drawing in WINDEV, WEBDEV and WINDEV Mobile.
Example
WINDEVWEBDEV - Server codeReports and QueriesJavaUser code (UMC)PHPAjax
Info_Image, Format are strings
Hauteur, Largeur are int
// Récupération des caractéristiques de l'image
Info_Image = InfoBitmap("C:\Windows\CARREAU.BMP")
Format = ExtractString(Info_Image, 1)
Largeur = Val(ExtractString(Info_Image, 2))
Hauteur = Val(ExtractString(Info_Image, 3))
// Affichage des caractéristiques
Info("Format de l'image : " + Format, "Largeur : " + Largeur, "Hauteur : " + Hauteur)
WEBDEV - Server code
// Redimensionnement d'un champ Image en WEBDEV
InfoImage is string
sCheminImage is string = CompleteDir(fWebDir()) + "MonImage.jpg"
Info_Image = InfoBitmap(sCheminImage)
// IMG_Image1 est un champ Image
IMG_Image1.Largeur = Val(ExtractString(Info_Image, 2))
IMG_Image1.Hauteur = Val(ExtractString(Info_Image, 3))
IMG_Image1 = "./../MonImage.jpg"
Syntax
<Result> = ImageInfo(<Image file name> [, <Desired information>])
<Result>: Character string
  • WINDEVReports and QueriesAndroidiPhone/iPadJavaUser code (UMC) Requested characteristic (if the <Requested information> parameter is specified).
  • All image characteristics in the following format:
    <Format> + TAB + <Width> + TAB + <Height> + TAB + <Bits/pixel>

    <Format>Character string
    • Three characters identifying the image format: "BMP", "GIF", "PDF", etc.
    • "BAD" if the image name is an non-existing file or if the format is unknown
    <Width>IntegerImage width in pixels.
    Note: The width and height can be inverted depending on the position of the (0,0) point of the image. To get the width and height taking into account the orientation of the image, use a variable of type Image.
    <Height>IntegerImage height in pixels.
    Note: The width and height can be inverted depending on the position of the (0,0) point of the image. To get the width and height taking into account the orientation of the image, use a variable of type Image.
    <Bits/pixel>Character stringNumber of bits per pixel:
    • 1 (monochrome image)
    • 4 (16-color palette)
    • 8 (256-color palette)
    • 24 (no palette, 16 millions of colors)
    • 32 (no palette, true color)
    AndroidAndroid Widget Java The number of bits per pixel is always equal to 0.
    Linux The number of bits per pixel is always 32.
  • If an error occurs, the following string is returned:
    "BAD" + TAB + TAB + TAB
<Image file name>: Character string
  • Name of the image or PDF file, including its full or relative path (up to 260 characters). A UNC path can be used.
  • Name of the control bound to an image memo item.
AndroidAndroid Widget Java The PDF files are not supported.
<Desired information>: Optional Integer constant
WINDEVReports and QueriesAndroidiPhone/iPadJavaUser code (UMC) Desired information.
ibWithAlphaLayerDetermines whether the image has an alpha channel. If this constant is used, <Result> will correspond to:
  • True if the image has an alpha channel,
  • False otherwise.
ibTransparencyColorDetermines whether the image has a transparent area. If this constant is used, <Result> will correspond to:
  • True if the image has a transparent area,
  • False otherwise.
ibListInfoPages
(Default value)
Gets information on each page of a multi-page image. Each page is separated by a carriage return (CR) character.
The information is returned in the following format:
Width + TAB + Height + TAB + Bits per pixel
where:
  • Width: Width in pixels.
  • Height: Height in pixels.
  • Bits per pixel: Number of bits per pixel:
    • 1 (monochrome image)
    • 4 (16-color palette)
    • 8 (256-color palette)
    • 24 (no palette, 16 millions of colors)
    • 32 (no palette, true color)
AndroidAndroid Widget Java The number of bits per pixel is always equal to 0.
Linux The number of bits per pixel is always 32.
Remarks

Miscellaneous

  • BitmapInfo can be used with PDF files.
    Note: the GDI + framework must be installed on the computer..
    AndroidAndroid Widget Java This feature is not available.
  • For WMF or EMF images, <Bits/pixel> is equal to 0.
  • The following image file formats are supported:
    • WINDEVWEBDEV - Server codeReports and Queries All the formats described in fGraphicFilter.
    • AndroidAndroid Widget Java JPEG, PNG, GIF or BMP.
    • PHP JPG, PNG, GIF, BMP. Depending on the version of the GD library, these formats may not be supported.
PHP

Drawing in PHP

In PHP, the drawing functions are based on the graphic library GD. This library is commonly used by the PHP hosting providers and therefore it is always enabled. The version of the GD library must be version 2.0.28 (or later). This library can be downloaded from the PHP site.
To enable (if necessary) this library locally, the following elements are required:
  • PHP installed.
  • the PHP.INI file found in the Windows directory must contain the following line: "extension=php_gd2.dll" (instead of ";extension=php_gd2.dll").
  • the php_gd2.dll file must exist in the directory of PHP extensions. This directory is defined in the PHP.INI file by the "extension_dir" variable.
Business / UI classification: Neutral code
Component: wd300obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/30/2025

Send a report | Local help