#include <GDIPlus.au3>
_GDIPlus_Startup()
Dim $iW = 199, $iH = 100, $aPixels[$iH][$iW]
$iWBytes = 3 * $iW + Mod($iW, 4)
Local $tPixel = DllStructCreate("BYTE[" & $iH * $iWBytes & "];")
For $iCoordY = 0 To $iH - 1
For $iCoordX = 0 To $iW - 1
$iRed = Round(255 * $iCoordX / ($iW - 1))
$iGreen = Round(255 * $iCoordY / ($iH - 1))
$iBlue = 0
$iOffset = $iCoordY * $iWBytes + 3 * $iCoordX
DllStructSetData($tPixel, 1, $iBlue, $iOffset + 1)
DllStructSetData($tPixel, 1, $iGreen, $iOffset + 2)
DllStructSetData($tPixel, 1, $iRed, $iOffset + 3)
Next
Next
$hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH, $GDIP_PXF24RGB, $iWBytes, $tPixel)
$sFile = FileSaveDialog("Save the result image", @ScriptDir, "All (*.*)|Image (*.jpg;*.png;*.bmp;*.gif;*.tif)|JPG (*.jpg)|PNG (*.png)|BMP (*.bmp)|GIF (*.gif)|TIF (*.tif)")
_GDIPlus_ImageSaveToFile($hBitmap, $sFile)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_Shutdown()