Newsgroup: it.comp.lang.visual-basic
Titolo: l'Api StretchBlt ...

Salve a tutti ...
chi di voi č cosě gentile da spiegarmi i vari parametri delle Api qui
sotto, in particolare il parametro dwRop della funzione StretchBlt ... e
possibilmente anche il loro uso esatto ...
grazie 100 .... Mauro
Declare Function StretchBlt Lib "gdi32" Alias "StretchBlt" (ByVal hdc As
Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal
nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As
Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As
Long) As Long
Declare Function StretchDIBits Lib "gdi32" Alias "StretchDIBits" (ByVal
hdc As Long, ByVal x As Long, ByVal y As Long, ByVal dx As Long, ByVal
dy As Long, ByVal SrcX As Long, ByVal SrcY As Long, ByVal wSrcWidth As
Long, ByVal wSrcHeight As Long, lpBits As Any, lpBitsInfo As BITMAPINFO,
ByVal wUsage As Long, ByVal dwRop As Long) As Long

hdc è l'handle del device contest di destinazione
x,y,nWidth,nHeight sono le coordinate del rettangolo di destinazione(x e y
riferite all'angolo superiore sinistro)
hSrcDC (hdcSrc) è l'handle del device contest di origine
xSrc,ySrc,nSrcWidth,nSrcHeight sono uguali alle precedenti ma riferite al
rettangolo di origine.
Veniamo adesso a dwRop cioè al raster operetion code,le ROP "sono codifiche
binarie che indicano
come si combinano questi tre elementi:l'immagine sorgente,lo sfondo
destinazione,e qualsiasi modello
sullo sfondo-destinazione."in parole povere indicano come windows combina i
colori del rettangolo
di origine con qelli del rettangolo di destinzione.
I codici ROP sono numeri Esadecimali che possono assumere 256
combinazioni,ma esistono 15
combinazioni con nome che sono praticamente i valori che puoi assegnare a
dwROP,le passo cosi come sono in inglese,scegli tra loro il valore per dwROP
che ti serve:
The following list shows some common raster operation codes: Value
Description
BLACKNESS
Fills the destination rectangle using the color associated with index 0 in
the physical palette. (This color is black for the default physical
palette.)
DSTINVERT
Inverts the destination rectangle.
MERGECOPY
Merges the colors of the source rectangle with the specified pattern by
using the Boolean AND operator.
MERGEPAINT
Merges the colors of the inverted source rectangle with the colors of the
destination rectangle by using the Boolean OR operator.
NOTSRCCOPY
Copies the inverted source rectangle to the destination.
NOTSRCERASE
Combines the colors of the source and destination rectangles by using the
Boolean OR operator and then inverts the resultant color.
PATCOPY
Copies the specified pattern into the destination bitmap.
PATINVERT
Combines the colors of the specified pattern with the colors of the
destination rectangle by using the Boolean XOR operator.
PATPAINT
Combines the colors of the pattern with the colors of the inverted source
rectangle by using the Boolean OR operator. The result of this operation is
combined with the colors of the destination rectangle by using the Boolean
OR operator.
SRCAND
Combines the colors of the source and destination rectangles by using the
Boolean AND operator.
SRCCOPY
Copies the source rectangle directly to the destination rectangle.
SRCERASE
Combines the inverted colors of the destination rectangle with the colors
of the source rectangle by using the Boolean AND operator.
SRCINVERT
Combines the colors of the source and destination rectangles by using the
Boolean XOR operator.
SRCPAINT
Combines the colors of the source and destination rectangles by using the
Boolean OR operator.
WHITENESS
Fills the destination rectangle using the color associated with index 1 in
the physical palette. (This color is white for the default physical
palette.)
Per ulteriori informazioni puoi contattarmi via E-MAIL.
Ciao
                carlo