CopyWidth:=200;
CopyHeight:=200;
w:=400*image1.Picture.Width div image1.width;
h:=200*image1.Picture.Height div image1.height;
Image2.Picture.Bitmap.Width := 640;// CopyWidth;
Image2.Picture.Bitmap.Height := 480;//CopyHeight;
img:=tbitmap.create;
img.Assign(image1.Picture.Graphic);
Image2.Picture.Bitmap.Canvas.CopyRect(Rect(0, 0, 640, 480), img.Canvas, Rect(w, h, CopyWidth + w, CopyHeight + h));
img.free;
yukardaki kodu forumlardan buldum şöyle bir sorum olacak
resmi image1 degilde direkt dosyadan çekip zoom yapıp image1 içine zoom yapılmış olarak nasıl atabiliriz?
saygılarımla
mesaj birleştirme:: 30 Mart 2013, 17:46:01
var
w,h,CopyWidth,CopyHeight:integer;
img:tbitmap;
jpg: TJPEGImage;
begin
jpg:=TJPEGImage.Create;
try
jpg.LoadFromFile('resim.jpg');
image1.Canvas.Draw(0, 0, jpg);
finally
jpg.Free;
end;
CopyWidth:=200;
CopyHeight:=200;
w:=400*image1.Picture.Width div image1.width;
h:=200*image1.Picture.Height div image1.height;
Image2.Picture.Bitmap.Width := 640;// CopyWidth;
Image2.Picture.Bitmap.Height := 480;//CopyHeight;
img:=tbitmap.create;
img.Assign(image1.Picture.Graphic);
Image1.Picture.Bitmap.Canvas.CopyRect(Rect(0, 0, 640, 480), img.Canvas, Rect(w, h, CopyWidth + w, CopyHeight + h));
img.free;
end;
bu şekilde bir şey yaptım ama daha iyi bir yolu varsa paylaşrsanız sevinirim
saygılarımla