Imo
2009-04-09 04:30:40 UTC
$B%-%c%W%A%c$7$?2hA|(B(bitmap)$B$K%/%m%9%X%"$rIA$/>l9g!"(B
$B2hA|(B(bitmap)$B$r(BStrechBlt$B$GI=<($7$?8e$K(BMoveTo-LineTo$B$G%/%m%9%X%"$rIA$/$H!!2hLL$,$A$i$D$$$F$7$^$$$^$9!#(B
bitmap$B$r=L>.I=<($9$k4X78$G85$N(Bbitmap$B$K%/%m%9%X%"$rKd$a9~$`>l9g!"=L>.N($r7W;;$7$FB@$$@~$rKd$a9~$^$J$1$l$P$J$j$^$;$s!#(B
$B$=$3$G!"(B
$B0lC6!"%a%b%j!<>e$K2hLL$N(BDC$B$HF1$8J*$r:***@.$7!"!!$=$3$K=L>.I=<($7$?(Bbitmap$B$rKd$a9~$_!!%/%m%9%X%"$rIA$$$F!!$=$N(BDC$B$r2hLL(BDC$B$K(BBitBlt$B$G%3%T!<$9$l$P!%!%!%!%$H;W$C$?$N$G$9$,!!I=<(=PMh$^$;$s!#(B
$B2?$+:,K\E*$K4V0c$C$F$$$k$N$G$7$g$&$+!)(B
MLOCAL int Xbitmap_disp( HDC hDC, BITMAPINFO *bi, char *bd, RECT *rc )
{
HBITMAP hBitmap;
HDC hdcBitmap;
HDC hdcBitmap2;
HDC hDCx;
bmp_width = (bi->bmiHeader).biWidth;
bmp_hight = (bi->bmiHeader).biHeight;
hBitmap = CreateDIBitmap( hDC
, (BITMAPINFOHEADER*) bi
, CBM_INIT
, (SBYT*) bd
, (BITMAPINFO*) bi
, DIB_RGB_COLORS);
hdcBitmap = CreateCompatibleDC( hDC ); // $B2hLL$HF1$8(BDC$B$N:***@.!J#1!K(B
hdcBitmap2 = CreateCompatibleDC( hDC ); // $B2hLL$HF1$8(BDC$B$N:***@.!J#2!K(B
SelectObject( hdcBitmap , hBitmap);
StretchBlt $B!!(B( hdcBitmap2 , rc->left, rc->top, rc->right -rc->left,
rc->bottom - rc->top
$B!!!!!!(B, hdcBitmap, 0, 0, bmp_width, bmp_hight,SRCCOPY );
// $B=L>.E=$jIU$1(B
DeleteObject( hdcBitmap );
DeleteObject( hBitmap );
{
int x1, x2, xm;
int y1, y2, ym;
HPEN hPen;
$B!!!!!!(BhPen = CreatePen( PS_SOLID, 0, RGB( 0x00, 0xFF, 0x00 ) );
SelectObject( hdcBitmap2 , hPen );
y1 = rc->top ;
x1 = rc->left ;
y2 = rc->bottom;
x2 = rc->right ;
xm = ( x1 + x2 ) / 2;
ym = ( y1 + y2 ) / 2;
MoveToEx( hdcBitmap2 , x1, ym, NULL ); // $B%/%m%9%X%"(B
LineTo ( hdcBitmap2 , x2, ym );
MoveToEx( hdcBitmap2 , xm, y1, NULL );
LineTo ( hdcBitmap2 , xm, y2 );
DeleteObject( hPen );
}
// $B2hLL(BDC$B$X$N%3%T!<!!(B///
BitBlt ( hDC, rc->left, rc->top, bmp_width,
bmp_hight,hdcBitmap2, rc->left, rc->top, SRCCOPY );
DeleteObject( hdcBitmap2);
}
$B2hA|(B(bitmap)$B$r(BStrechBlt$B$GI=<($7$?8e$K(BMoveTo-LineTo$B$G%/%m%9%X%"$rIA$/$H!!2hLL$,$A$i$D$$$F$7$^$$$^$9!#(B
bitmap$B$r=L>.I=<($9$k4X78$G85$N(Bbitmap$B$K%/%m%9%X%"$rKd$a9~$`>l9g!"=L>.N($r7W;;$7$FB@$$@~$rKd$a9~$^$J$1$l$P$J$j$^$;$s!#(B
$B$=$3$G!"(B
$B0lC6!"%a%b%j!<>e$K2hLL$N(BDC$B$HF1$8J*$r:***@.$7!"!!$=$3$K=L>.I=<($7$?(Bbitmap$B$rKd$a9~$_!!%/%m%9%X%"$rIA$$$F!!$=$N(BDC$B$r2hLL(BDC$B$K(BBitBlt$B$G%3%T!<$9$l$P!%!%!%!%$H;W$C$?$N$G$9$,!!I=<(=PMh$^$;$s!#(B
$B2?$+:,K\E*$K4V0c$C$F$$$k$N$G$7$g$&$+!)(B
MLOCAL int Xbitmap_disp( HDC hDC, BITMAPINFO *bi, char *bd, RECT *rc )
{
HBITMAP hBitmap;
HDC hdcBitmap;
HDC hdcBitmap2;
HDC hDCx;
bmp_width = (bi->bmiHeader).biWidth;
bmp_hight = (bi->bmiHeader).biHeight;
hBitmap = CreateDIBitmap( hDC
, (BITMAPINFOHEADER*) bi
, CBM_INIT
, (SBYT*) bd
, (BITMAPINFO*) bi
, DIB_RGB_COLORS);
hdcBitmap = CreateCompatibleDC( hDC ); // $B2hLL$HF1$8(BDC$B$N:***@.!J#1!K(B
hdcBitmap2 = CreateCompatibleDC( hDC ); // $B2hLL$HF1$8(BDC$B$N:***@.!J#2!K(B
SelectObject( hdcBitmap , hBitmap);
StretchBlt $B!!(B( hdcBitmap2 , rc->left, rc->top, rc->right -rc->left,
rc->bottom - rc->top
$B!!!!!!(B, hdcBitmap, 0, 0, bmp_width, bmp_hight,SRCCOPY );
// $B=L>.E=$jIU$1(B
DeleteObject( hdcBitmap );
DeleteObject( hBitmap );
{
int x1, x2, xm;
int y1, y2, ym;
HPEN hPen;
$B!!!!!!(BhPen = CreatePen( PS_SOLID, 0, RGB( 0x00, 0xFF, 0x00 ) );
SelectObject( hdcBitmap2 , hPen );
y1 = rc->top ;
x1 = rc->left ;
y2 = rc->bottom;
x2 = rc->right ;
xm = ( x1 + x2 ) / 2;
ym = ( y1 + y2 ) / 2;
MoveToEx( hdcBitmap2 , x1, ym, NULL ); // $B%/%m%9%X%"(B
LineTo ( hdcBitmap2 , x2, ym );
MoveToEx( hdcBitmap2 , xm, y1, NULL );
LineTo ( hdcBitmap2 , xm, y2 );
DeleteObject( hPen );
}
// $B2hLL(BDC$B$X$N%3%T!<!!(B///
BitBlt ( hDC, rc->left, rc->top, bmp_width,
bmp_hight,hdcBitmap2, rc->left, rc->top, SRCCOPY );
DeleteObject( hdcBitmap2);
}