Board index » delphi » copyrect function

copyrect function

Hi

my little problem:

I have a picture with more symbols.
Each symbol has the same transparent color.
i am doing like this...

symbol.LoadfromFile(....);
symbol.dormant;
symbol.freeimage;
symbol.transparentcolor:=rgb(255,0,255);
symbol.transparent:=true;

now drawing the rect to the canvas...

source:=rect(60,0,80,20);
dest:=rect(0,0,20,20);
canvas.copyrect(dest,symbol.canvas,source);

the image will not drawn transparent.
With Canvas.Draw function all works - but i need
only a rectange of the symbol bitmap.

Also the BrushCopy function works but borland says
you should not use this, because its old...

Anyone knows a solution ???

best regards

Harald

 

Re:copyrect function


Quote
"hari" <al...@xpoint.at> wrote in message news:3a6ec52d_2@dnews...
> I have a picture with more symbols.
> Each symbol has the same transparent color.
> i am doing like this...

> symbol.LoadfromFile(....);
> symbol.dormant;
> symbol.freeimage;
> symbol.transparentcolor:=rgb(255,0,255);
> symbol.transparent:=true;

> now drawing the rect to the canvas...

> source:=rect(60,0,80,20);
> dest:=rect(0,0,20,20);
> canvas.copyrect(dest,symbol.canvas,source);

> the image will not drawn transparent.
> With Canvas.Draw function all works - but i need
> only a rectange of the symbol bitmap.

Maybe you should use a small intermediate bitmap
to get this rectangle with CopyRect and draw it to Canvas with Draw?
Serge

Re:copyrect function


Check TransparentMode.
Quote
hari <al...@xpoint.at> wrote in message news:3a6ec52d_2@dnews...
> Hi

> my little problem:

> I have a picture with more symbols.
> Each symbol has the same transparent color.
> i am doing like this...

> symbol.LoadfromFile(....);
> symbol.dormant;
> symbol.freeimage;
> symbol.transparentcolor:=rgb(255,0,255);
> symbol.transparent:=true;

> now drawing the rect to the canvas...

> source:=rect(60,0,80,20);
> dest:=rect(0,0,20,20);
> canvas.copyrect(dest,symbol.canvas,source);

> the image will not drawn transparent.
> With Canvas.Draw function all works - but i need
> only a rectange of the symbol bitmap.

> Also the BrushCopy function works but borland says
> you should not use this, because its old...

> Anyone knows a solution ???

> best regards

> Harald

Other Threads