
19.03.2012, 22:49
|
 |
.
|
|
Регистрация: 18.05.2011
Адрес: Омск
Сообщения: 3,970
Версия Delphi: 3,5,7,10,12,XE2
Репутация: выкл
|
|
На форме лежит Image1 на нём Image2. В Image1 картинка уже загружена:
Код:
procedure TForm1.FormCreate(Sender: TObject);
var
aRect : TRect;
bmp : TBitmap;
begin
bmp := TBitmap.Create;
try
SetRect(aRect, Image2.Left - Image1.Left, Image2.Top - Image1.Top, Image2.Left + Image2.Width - Image1.Left, Image2.Top + Image2.Height - Image1.Top);
bmp.Width := Image1.Width;
bmp.Height := Image1.Height;
bmp.Canvas.StretchDraw(bmp.Canvas.ClipRect, Image1.Picture.Graphic);
Image2.Canvas.CopyRect(Image2.Canvas.ClipRect, bmp.Canvas, aRect);
finally
bmp.Free;
end;
end;
Цитата:
нашел решение
Цитата:
BitBlt(dest.Canvas.Handle, 0, 0, dest.Width,
dest.Height, src.Canvas.Handle,
dest.Left, dest.Top, SRCCOPY);
|
Это несколько не то. С изображениями отличными от битмап (jpg к примеру) работать не будет.
__________________
Je venus de nulle part
55.026263 с.ш., 73.397636 в.д.
|