Cr�e un nouveau bitmap en copiant une partie rectangulaire d'un bitmap source
#include <GDIPlus.au3>
_GDIPlus_BitmapCloneArea ( $hBitmap, $nLeft, $nTop, $nWidth, $nHeight [, $iFormat = $GDIP_PXF24RGB] )
$hBitmap | Handle de l'objet Bitmap |
$nLeft | Coordonn�e X du coin sup�rieur gauche du rectangle � copier |
$nTop | Coordonn�e Y du coin sup�rieur gauche du rectangle � copier |
$nWidth | Largeur du rectangle qui sp�cifie la partie du Bitmap � copier |
$nHeight | Hauteur du rectangle qui sp�cifie la partie du Bitmap � copier |
$iFormat | [optionnel] Format de pixel pour le nouveau Bitmap: $GDIP_PXF01INDEXED = 1 bit par pixel, index� $GDIP_PXF04INDEXED = 4 bits par pixel, index� $GDIP_PXF08INDEXED = 8 bits par pixel, index� $GDIP_PXF16GRAYSCALE = 16 bits par pixel, niveaux de gris $GDIP_PXF16RGB555 = 16 bits par pixel; 5 bits pour chaque composante RVB $GDIP_PXF16RGB565 = 16 bits par pixel; 5 bits pour le rouge, 6 bits pour le vert et 5 bits pour le bleu $GDIP_PXF16ARGB1555 = 16 bits par pixel; 1 bit pour la transparence et 5 bits pour chaque composante RVB $GDIP_PXF24RGB = 24 bits par pixel; 8 bits pour chaque composante RVB $GDIP_PXF32RGB = 32 bits par pixel; 8 bits pour chaque composante RVB. Pas de composante de transparence. $GDIP_PXF32ARGB = 32 bits par pixel; 8 bits pour chaque composante RVB et composante de transparence $GDIP_PXF32PARGB = 32 bits par pixel; 8 bits pour chaque composante RVB et composante de transparence, pr�-multipli� $GDIP_PXF48RGB = 48 bits par pixel; 16 bits pour chaque composante RVB $GDIP_PXF64ARGB = 64 bits par pixel; 16 bits pour chaque composante RVB et composante de transparence $GDIP_PXF64PARGB = 64 bits par pixel; 16 bits pour chaque composante RVB et composante de transparence, pr�-multipli� |
Succ�s: | Retourne le handle du nouvel objet Bitmap |
�chec: | Retourne 0 et d�finit @error <> 0, @extended contient le code erreur GPSTATUS ($GPID_ERR*). |
Lorsque vous en avez termin� avec l'objet Bitmap, appelez _GDIPlus_BitmapDispose() pour lib�rer les ressources.
_GDIPlus_BitmapDispose, _GDIPlus_ImageGetPixelFormat
Consultez GdipCloneBitmapAreaI dans la Librairie MSDN.
#include <GDIPlus.au3> #include <ScreenCapture.au3> #include <WinAPIHObj.au3> Example() Func Example() Local $hBitmap, $hClone, $hImage, $iX, $iY ; Initialise la biblioth�que GDI + _GDIPlus_Startup() ; Capture un bitmap 32 bits $hBitmap = _ScreenCapture_Capture("") $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap) ; Cr�e un clone 24 bits du bitmap $iX = _GDIPlus_ImageGetWidth($hImage) $iY = _GDIPlus_ImageGetHeight($hImage) $hClone = _GDIPlus_BitmapCloneArea($hImage, 0, 0, $iX, $iY, $GDIP_PXF24RGB) ; Enregistre le bitmap dans un fichier _GDIPlus_ImageSaveToFile($hClone, @MyDocumentsDir & "\GDIPlus_Image.bmp") ; Nettoie les ressources _GDIPlus_ImageDispose($hClone) _GDIPlus_ImageDispose($hImage) _WinAPI_DeleteObject($hBitmap) ; Arr�te la biblioth�que GDI + _GDIPlus_Shutdown() ShellExecute(@MyDocumentsDir & "\GDIPlus_Image.jpg") EndFunc ;==>Example