C# İLE SCREENSHOT ALMA VE ALINAN GÖRÜNTÜNÜN KAYDEDİLMESİ
Oluşturduğumuz buttona çift tıklayarak fonksiyonumuzu oluşturuyoruz.
private void
button6_Click(object sender, EventArgs e)
{
Bitmap screenshot = new Bitmap(this.Width-20,
this.Height-120);
Graphics grafik = Graphics.FromImage((Image)screenshot);
grafik.CopyFromScreen(this.Location.X+10, this.Location.Y+110, 0, 0, this.Size);
string isim = Path.GetRandomFileName();
screenshot.Save("d://"+isim+".png", ImageFormat.Png);
MessageBox.Show("Dosya IMG-" + isim + " ismiyle kaydedildi.");
}
Yorumlar
Yorum Gönder