Board index » cppbuilder » About Bitmap->Canvas->CopyRect

About Bitmap->Canvas->CopyRect

Hi,
Dose any know how to use CopyRect to copy the small portion of one Bitmap
file to another bitmap file?
 

Re:About Bitmap->Canvas->CopyRect


Adward,

Is this what you are looking for?

 TRect *DRect;
  DRect = new TRect;
 TRect *SRect;
 SRect = new TRect;

 DRect->Top=0;
 DRect->Left=0;
 DRect->Right=PaintBoxCad->Width;
 DRect->Bottom=PaintBoxCad->Height;

 SRect->Top=ScrollBarVertical->Position;
 SRect->Left=ScrollBarHorizontal->Position;
 SRect->Right=ScrollBarHorizontal->Position+PaintBoxCad->Width;
 SRect->Bottom=ScrollBarVertical->Position+PaintBoxCad->Height;

 PaintBoxCad->Canvas->CopyRect
  (*DRect,GblABFCad->Bitmap->Canvas,*SRect);

 delete DRect ;
 delete SRect;

Quote
"Adward Lee" <adward_...@seed.net.tw> wrote in message

news:3b3094fa$1_2@dnews...
Quote
> Hi,
> Dose any know how to use CopyRect to copy the small portion of one Bitmap
> file to another bitmap file?

Other Threads