Board index » cppbuilder » How to use SelectClipRgn
Jean Grey
![]() CBuilder Developer |
Jean Grey
![]() CBuilder Developer |
How to use SelectClipRgn2003-09-30 02:00:22 PM cppbuilder71 Hi, everyone. -o) I have this simple question about rectangles. What if i have a canvas and i keep on printing on it but i have to cut the image off which is beyond certain margins (the margins are indicated by a rectangle). How do I use SelectClipRgn to do it? Thanks in advance! |
Jean Grey
![]() CBuilder Developer |
2003-09-30 03:10:21 PM
Re:How to use SelectClipRgn
OOps ... I think I asked the wrong question. Anyway, now I'm using CopyRect to do it.
"Jean Grey" < XXXX@XXXXX.COM >wrote: Quote
|
Junk Mail
![]() CBuilder Developer |
2003-10-01 03:47:21 AM
Re:How to use SelectClipRgn
"Jean Grey" < XXXX@XXXXX.COM >wrote in message
Quote
SelectClipRgn to do it? Quote>Thanks in advance! { Graphics::TBitmap* bmp = new Graphics::TBitmap; bmp->LoadFromFile("C:\\Program Files\\Common Files\\Borland Shared\\Images\\Splash\\256Color\\Chemical.bmp"); //the dimensions of this file are 240x180 //lets say you want to do a 100x150 region //with an offset of 20 on the x and 10 on the y int xOff = 20; int yOff = 10; int widthOfRegion = 100; int heightOfRegion = 150; //also lets say you want to draw the bmp on the //mainform with dimensions of 80x90 //with an offest of 60 on the x and 70 on the y of the mainform int xOff2 = 60; int yOff2 = 70; int widthOfRegion2 = 80; int heightOfRegion2 = 90; Canvas->CopyRect( //first rect is destination TRect(xOff2, yOff2, xOff2 + widthOfRegion2, yOff2 + heightOfRegion2) //second is canvas of source ,bmp->Canvas //third is rect of source that you want to copy ,TRect(xOff, yOff, xOff + widthOfRegion, yOff + heightOfRegion) ); } {smallsort} |