ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Drawing functions
  • Miscellaneous
  • Pattern and PHP
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
Retrieves the characteristics of an image file or the characteristics of a PDF file:
  • format,
  • width and height,
  • number of bits per pixel.
AndroidAndroid Widget Java The PDF files are not supported.
Linux Caution: A specific configuration is required to use this function in Linux. For more details, see The drawings.
Example
WINDEVWEBDEV - Server codeReports and QueriesJavaUser code (UMC)PHPAjax
ImageInfo, Format are strings
Height, Width are int
// Retrieve the characteristics of the image
ImageInfo = BitmapInfo("C:\Windows\TILES.BMP")
Format = ExtractString(ImageInfo, 1)
Width = Val(ExtractString(ImageInfo, 2))
Height = Val(ExtractString(ImageInfo, 3))
// Display the characteristics
Info("Format of the image: " + Format, "Width: " + Width, "Height: " + Height)
WEBDEV - Server code
// Resize an Image control in WEBDEV
ImageInfo is string
sImagePath is string = CompleteDir(fWebDir()) + "MyImage.jpg"
 
ImageInfo = BitmapInfo(sImagePath)
 
// IMG_Image1 is an Image control
IMG_Image1.Width = Val(ExtractString(ImageInfo, 2))
IMG_Image1.Height = Val(ExtractString(ImageInfo, 3))
IMG_Image1 = "./../MyImage.jpg"
Syntax
<Result> = BitmapInfo(<Image file name>)
<Result>: Character string
  • Characteristics of the image in the following format:
    <Format> + TAB + <Width> + TAB + <Height> + TAB + <Bits/pixel>

    <Format>Character string
    • Three characters are used to identify the image format: "BMP", "GIF", "PDF", ...
    • "BAD" if the image nameis an non-existing file or if the format is unknown
    <Width>IntegerImage width in pixels.
    Remark: 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.
    Remark: 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 equal to 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.
Remarks

Miscellaneous

  • BitmapInfo can be used with PDF files.
    Caution: 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

Pattern and 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: wd290obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/16/2024

Send a report | Local help