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.
Linux Caution: In Linux, this function requires a specific configuration. For more details, see Drawing in WINDEV, WEBDEV and WINDEV Mobile.
Example
WEBDEV - Server codePHPAjax
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
  • 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)
    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.
<Desired information>: Optional Integer constant
Remarks

Miscellaneous

  • BitmapInfo can be used with PDF files.
    Note: the GDI + framework must be installed on the computer..
  • For WMF or EMF images, <Bits/pixel> is equal to 0.
  • The following image file formats are supported:
    • WEBDEV - Server code All the formats described in fGraphicFilter.
    • 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