I am also thinking that if there is a way to capture the entire screen to a
canvas (Like a printscreen function would probably do) then I could use
screentoclient() and clienttoscreen() methods to copy my rect out of that.
Thanks
Wayne Fulcher
Digital Dimensions, Inc.
wa...@ddinet.com
706-869-9993
In this example a Button will be sitting on top of a Panel, and we are
getting the bitmap
which the button will obscure.
Get the Buttons parent, ie the Panel, which will be a TWinControl.
Create a bitmap the same size as the Button.
Paint the win control to the bitmap, using
PaintTo(newBitmap.Canvas.Handle, -Button1.Left, -Button1.Top).
Code will look something like this (not tested...)
function getScreenAreaBehind(aComponent :TComponent) :TBitmap;
var
container :TWinControl;
bitmap :TBitmap;
begin
container := aComponent.parent;
bitmap := TBitmap.create;
with bitmap do
begin
width := Button1.width;
height := button1.height;
end;
container.PaintTo(bitmap.canvas.handle, -aComponent.Left, -aComponent.Top);
result := bitmap;
end;
Wayne Fulcher wrote in message <7123pq$72...@forums.borland.com>...
There is nothing behind your component <g>. At runtime the components on a
form are all created before the form is shown, so when the parent of your
control proceeds to paint itself the first time it will not bother to paint
the part covered by your component (since it has the WS_CLIPCHILDREN window
style). The only option you have is to make your control invisible, then use
Pauls PaintTo trick and finally make your control visible again.
Peter Below (TeamB) 10011...@compuserve.com)