Panel i resim olarak kaydedebilirmiyiz.
Arama yaptım ekranda belirli bir alanı resim olarak alabiliyorum fakat Panelin boyutları ekran sınırları içinde olmayabilir.
Kod: Tümünü seç
Panel1.Brush.Bitmap.SaveToFile('ss.bmp')
İyi Çalışmalar
Kod: Tümünü seç
Panel1.Brush.Bitmap.SaveToFile('ss.bmp')
Kod: Tümünü seç
procedure TForm1.BitBtn1Click(Sender: TObject);
var
hh, hdev : hdc;
bm : hbitmap;
a, h, w : integer;
begin
hh := CreateCompatibleDC(GetDC(handle));
bm := CreateCompatibleBitmap(GetDC(handle), Panel2.Width, Panel2.Height);
SelectObject(hh,bm);
hdev:=GetWindowDC(Panel2.Handle);
BitBlt(image3.Canvas.Handle, 0, 0, Panel2.Width, Panel2.Height, hdev, Panel2.Left, Panel2.Top, SRCCOPY);
image3.Picture.SaveToFile('c:\deneme.bmp');
end;
Kod: Tümünü seç
hdev:=GetWindowDC(Panel2.Handle);
Kod: Tümünü seç
procedure TForm1.Button1Click(Sender: TObject);
var BMP: TBitMap;
begin
BMP:=TBitMap.Create;
try
BMP.Width:=Round(Panel1.Width);
BMP.Height:=Round(Panel1.Height);
BitBlt(bmp.Canvas.Handle,0,0,Panel1.Width,Panel1.Height,GetWindowDc(Panel1.Handle),0,0,SRCCOPY);
BMP.SaveToFile('HusoPanel.bmp');
finally
BMP.Free;
end;
end;
Kod: Tümünü seç
HorzScrollBar.Position := Form1.Width;
Kod: Tümünü seç
image1.Canvas.CopyRect(Rect(0,0,RzPanel1.Width,RzPanel1.Height), RzPanel1.Canvas, Rect(0,0,image1.Width,image1.Height));
image1.Picture.SaveToFile('c:\deneme.bmp');