关于dc的问题
请看代码[code=C/C++][/code]void TiButton::DispPic( HDC hdc,POINT& start_pos )
{
if(back_png_ == NULL)
return;
int width = back_png_->nWidth;
int height = back_png_->nHeight;
CDC mem_dc;
CBitmap mem_bitmap;
mem_dc.CreateCompatibleDC(hdc);
mem_bitmap.CreateCompatibleBitmap(hdc, width,height );
mem_dc.SelectBitmap(mem_bitmap);
mem_dc.BitBlt(0, 0,width, height, bk_dc_, 0, 0, SRCCOPY);
CDCHandle pDC = hdc;
if(back_png_)
{
Png32_Show(mem_dc,0,0,back_png_->nWidth,back_png_->nHeight,back_png_,0,0);
}
if(front_png_)
{
int temp_left = (back_png_->nWidth - front_png_->nWidth) / 2;
int temp_top = (back_png_->nHeight - front_png_->nHeight) / 2;
Png32_Show(mem_dc,temp_left,temp_top,front_png_->nWidth,front_png_->nHeight,front_png_,0,0);
}
if (front_front_png_ && is_front_front_)
{
int temp_left = (back_png_->nWidth - front_front_png_->nWidth) / 2;
int temp_top = (back_png_->nHeight - front_front_png_->nHeight) / 2;
Png32_Show(mem_dc,temp_left,temp_top,front_front_png_->nWidth,front_front_png_->nHeight,front_front_png_,0,0);
}
pDC.BitBlt(start_pos.x, start_pos.y,width+start_pos.x, height+start_pos.y, mem_dc, 0, 0, SRCCOPY);
mem_bitmap.DeleteObject();
mem_dc.DeleteDC();
}
[解决办法]
code=C/C++]代码要贴在这对方括号中间,而不是后面[/code
[解决办法]
怎么是HDC 啊
[解决办法]
这不太可能吧,int赋值而已。