Board index » delphi » Re: in a transperent component

Re: in a transperent component


2004-09-02 03:48:31 PM
delphi53
Assuming the components on a form, why don't you use the form's canvas?
"ici" <XXXX@XXXXX.COM>writes
Quote
how I can reach the screen canvas

I need to get the background of some component

to make it transperent, thanks on advance.


yours Omer h.




 
 

Re: in a transperent component

Quote
how I can reach the screen canvas
ScreenCanvas := TCanvas.Create;
try
ScreenDC := GetDC(0);
try
ScreenCanvas.Handle := GetDC(0);
[...]
finally
ReleaseDC(0);
end;
finally
ScreenCanvas.Free;
end;
Quote
I need to get the background of some component
to make it transperent, thanks on advance.
You cannot do it this way. As soon as your control is there, it becomes part
of the screen canvas. So you can only get the background this way before
showing your form. If you tell us more, maybe we can help you.
Jens
 

Re: in a transperent component

Quote
ReleaseDC(0);
ReleaseDC(ScreenDC) I mean :-)
Jens
 

Re: in a transperent component

I must have been in a hurry. The code was completely wrong, sorry about
that.
ScreenCanvas := TCanvas.Create;
try
ScreenDC := GetDC(0);
try
ScreenCanvas.Handle := ScreenDC;
[...]
finally
ReleaseDC(ScreenDC);
end;
finally
ScreenCanvas.Free;
end;
Jens
 

Re: in a transperent component

thanx for repaly :)
well Jens am doing a transparent text scroll
I got some one else code and change it to fit
so I added shadow to the fonts
and I added transparency depending on some image
// but it is better to make my scroll unvisble then capture the screen to
paint it better is choice
:))
am doing now adding scrolled images inside the scroll
omr
"Jens Gruschel" <XXXX@XXXXX.COM>writes
Quote
I must have been in a hurry. The code was completely wrong, sorry about
that.

ScreenCanvas := TCanvas.Create;
try
ScreenDC := GetDC(0);
try
ScreenCanvas.Handle := ScreenDC;
[...]
finally
ReleaseDC(ScreenDC);
end;
finally
ScreenCanvas.Free;
end;

Jens