PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
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
Copies the RGB pixels of the image into a one-dimensional or two-dimensional array. The array of colors is cleared then it is filled with the integers representing the colors (24 bits) of the image.
Example
arrLightness is array of * by * int

dImageToArray("c:\test.png", arrLightness, dComponentRed + dGrayScale)

dStartDrawing(IMG_NoName2)
nx, ny are int
FOR nx = 1 _TO_ ArrayInfo(arrLightness, tiNumberRows)
FOR ny = 1 _TO_ ArrayInfo(arrLightness, tiNumberColumns)
dPoint(nx-1, ny-1, arrLightness[nx][ny])
END
END
Syntax

Copying the pixels of an image file into an array Hide the details

dImageToArray(<Image File> , <Array> [, <Options>])
<Image File>: Character string (with quotes)
Path of image file to use.
<Array>: Array variable
Name of the array of 24-bit color into which the pixels will be copied. This array can be a one-dimensional array or a two-dimensional array. For a two-dimensional array, the dimensions represent the X and Y axes of the image.
<Options>: Optional Integer constant (or combination of constants)
Options for calculating the array:
dComponentBlueThe Blue component of the image will be copied into the array.
dComponentRedThe Red component of the image will be copied into the array.
dComponentRGBAll the components of the image will be copied into the array.
dComponentGreenThe Green component of the image will be copied into the array.
dGrayScaleThe image in grayscale will be copied into the array.

Copying the pixels of an image in memory into an array Hide the details

dImageToArray(<Image in Memory> , <Array> [, <Options>])
<Image in Memory>: Buffer or character string
Byte string containing the image to use. This parameter can correspond to an image saved in memory (dSaveImageBMP, dSaveImageGIF, ...).
<Array>: Array variable
Name of the array of 24-bit color into which the pixels will be copied. This array can be a one-dimensional array or a two-dimensional array. For a two-dimensional array, the dimensions represent the X and Y axes of the image.
<Options>: Optional Integer constant (or combination of constants)
Options for calculating the array:
dComponentBlueThe Blue component of the image will be copied into the array.
dComponentRedThe Red component of the image will be copied into the array.
dComponentRGBAll the components of the image will be copied into the array.
dComponentGreenThe Green component of the image will be copied into the array.
dGrayScaleThe image in grayscale will be copied into the array.
Remarks
The alpha layer of the image is not returned by this function.
Components
WINDEVReports and Queries wd230img.dll
Windows Mobile wp230img.dll
Linux wd230img.so
Minimum required version
  • Version 16
This page is also available for…
Comments
Click [Add] to post a comment