X
xzxiaohai
Unregistered / Unconfirmed
GUEST, unregistred user!
窗口是透明的,我想要在窗口中出现什么,然后在程序的image中就出现什么.
下面是代码:
var dc :hdc;
mc :TCanvas;
mr :TRect;
begin
dc :=GetWindowDC(0);
mc :=TCanvas.Create;
try
mc.Handle :=dc;
mr :=Rect(my_Form1.Left ,my_Form1.Top,Image1.Width,Image1.Height); //
if bmp<>nil then bmp.Free;
bmp:=TBitmap.Create;
bmp.PixelFormat:=pf24bit;
bmp.Width:=mr.Right;
bmp.Canvas.CopyRect(mr,mc,mr);
Image1.Picture.Bitmap:=bmp;
finally
mc.Handle:=0;
mc.Free;
ReleaseDC(0,dc);
end;
end;
应该修改哪里???
下面是代码:
var dc :hdc;
mc :TCanvas;
mr :TRect;
begin
dc :=GetWindowDC(0);
mc :=TCanvas.Create;
try
mc.Handle :=dc;
mr :=Rect(my_Form1.Left ,my_Form1.Top,Image1.Width,Image1.Height); //
if bmp<>nil then bmp.Free;
bmp:=TBitmap.Create;
bmp.PixelFormat:=pf24bit;
bmp.Width:=mr.Right;
bmp.Canvas.CopyRect(mr,mc,mr);
Image1.Picture.Bitmap:=bmp;
finally
mc.Handle:=0;
mc.Free;
ReleaseDC(0,dc);
end;
end;
应该修改哪里???