ビットマップを拡大・縮小してコピーする
Declare Function StretchBlt lib "gdi32.dll" _
(ByVal hdcDest As Long, ByVal nXOriginDest As Long, _
ByVal nYOriginDest As Long, ByVal nWidthDest As Long, _
ByVal hHeightDest As Long, ByVal hdcSrc As Long, _
ByVal nXOriginSrc As Long, ByVal nYOriginSrc As Long, _
ByVal nWidthSrc As Long, ByVal nHeightSrc As Long, _
ByVal dwRop As Long) As Long
Declare Function StretchBlt lib "gdi32.dll" _
(ByVal hdcDest As Integer, ByVal nXOriginDest As Integer, _
ByVal nYOriginDest As Integer, ByVal nWidthDest As Integer, _
ByVal hHeightDest As Integer, ByVal hdcSrc As Integer, _
ByVal nXOriginSrc As Integer, ByVal nYOriginSrc As Integer, _
ByVal nWidthSrc As Integer, ByVal nHeightSrc As Integer, _
ByVal dwRop As Integer) As Integer
BOOL StretchBlt(
HDC hdcDest,
int nXOriginDest,
int nYOriginDest,
int nWidthDest,
int nHeightDest,
HDC hdcSrc,
int nXOriginSrc,
int nYOriginSrc,
int nWidthSrc,
int nHeightSrc,
DWORD dwRop
);
System.Drawing.Graphics.DrawImage
引数
hdcDest
コピー先のデバイスコンテキストのハンドルnXOriginDest
描画する位置の左上隅のX座標nYOriginDest
同、Y座標nWidthDest
同、幅hHeightDest
同、高さhdcSrc
コピー元のデバイスコンテキストのハンドルnXOriginSrc
同、左上隅のX座標nYOriginSrc
同、Y座標nWidthSrc
同、幅nHeightSrc
同、高さdwRop
ラスタ操作コードの定数戻り値
正常終了のとき 0以外備考
エラーのとき 0
デバイスがこの関数をサポートしているわけではないのでdwRopの定数
GetDeviceCaps()関数を使ってあらかじめ調べること。
コピー元、コピー先、パターンのカラーの設定が異なる場合は
コピー先の設定に自動的に変換される。
nWidthSrcとnHeightSrcの数値の符号を操作することでイメージを上下左右に反転できる。
nWidthSrcとnWidthDestの符合が違うとき、コピーされたイメージはX軸回りに反転する。
同様に、nHeightSrcとnHeightDestのときは、Y軸回りに反転する。
BLACKNESS = &H42 0
DSTINVERT = &H550009 Not D
MERGECOPY = &HC000CA S And P
MERGEPAINT = &HBB0226 Not(S) or D
NOTSRCCOPY = &H330008 Not S
NOTSRCERASE = &H1100A6 Not(S Or D)
PATCOPY = &HF00021 P
PATINVERT = &H5A0049 P Xor D
PATPAINT = &HFB0A09 (P Or Not(S)) Or D
SRCAND = &H8800C6 S And D
SRCCOPY = &HCC0020 S
SRCERASE = &H440328 Not(D) And S
SRCINVERT = &H660046 S Xor D
SRCPAINT = &HEE0086 S Or D
WHITENESS = &HFF0062 1