Not
Bu sayfaya erişim yetkilendirme gerektiriyor. Oturum açmayı veya dizinleri değiştirmeyi deneyebilirsiniz.
Bu sayfaya erişim yetkilendirme gerektiriyor. Dizinleri değiştirmeyi deneyebilirsiniz.
Uygulamalarınızda dosya olarak bulunan görüntüleri işlemek için GDI+ kullanabilirsiniz. Bunu yapmak için, bir Image sınıfının yeni bir nesnesini (örneğin Bitmap) oluşturun, kullanmak istediğiniz çizim yüzeyine başvuran bir Graphics nesne yaratın ve DrawImage nesnesinin Graphics metodunu çağırın. Görüntü, grafik sınıfı tarafından temsil edilen çizim yüzeyine boyanacaktır. Görüntü Düzenleyicisi'ni kullanarak tasarım zamanında görüntü dosyaları oluşturabilir ve düzenleyebilir ve bunları çalışma zamanında GDI+ ile işleyebilirsiniz. Daha fazla bilgi için bkz. Simgeler için Görüntü Düzenleyicisi.
GDI+ ile görüntü işlemek için
Görüntülemek istediğiniz görüntüyü temsil eden bir nesne oluşturun. Bu nesne, Image'den devralan bir sınıfa ait bir üye olmalıdır; örneğin, Bitmap veya Metafile gibi. Bir örnek gösterilmiştir:
' Uses the System.Environment.GetFolderPath to get the path to the ' current user's MyPictures folder. Dim myBitmap as New Bitmap _ (System.Environment.GetFolderPath _ (System.Environment.SpecialFolder.MyPictures))// Uses the System.Environment.GetFolderPath to get the path to the // current user's MyPictures folder. Bitmap myBitmap = new Bitmap (System.Environment.GetFolderPath (System.Environment.SpecialFolder.MyPictures));// Uses the System.Environment.GetFolderPath to get the path to the // current user's MyPictures folder. Bitmap^ myBitmap = gcnew Bitmap (System::Environment::GetFolderPath (System::Environment::SpecialFolder::MyPictures));Kullanmak istediğiniz çizim yüzeyini temsil eden bir Graphics nesne oluşturun. Daha fazla bilgi için bkz . Nasıl yapılır: Çizim için Grafik Nesneleri Oluşturma.
' Creates a Graphics object that represents the drawing surface of ' Button1. Dim g as Graphics = Button1.CreateGraphics// Creates a Graphics object that represents the drawing surface of // Button1. Graphics g = Button1.CreateGraphics();// Creates a Graphics object that represents the drawing surface of // Button1. Graphics^ g = button1->CreateGraphics();DrawImage Görüntüyü işlemek için grafik nesnenizin öğesini çağırın. Hem çizilecek görüntüyü hem de çizilecek koordinatları belirtmeniz gerekir.
g.DrawImage(myBitmap, 1, 1)g.DrawImage(myBitmap, 1, 1);g->DrawImage(myBitmap, 1, 1);
Ayrıca bakınız
- Grafik Programlamaya Başlarken
- Nasıl Yapılır: Çizim için Grafik Nesneleri Oluşturma
- GDI+'da Kalemler, Çizgiler ve Dikdörtgenler
- Nasıl yapılır: Windows Form Üzerinde Metin Çizme
- Windows Forms'ta Grafik ve Çizim
- Çizim Çizgileri veya Kapalı Şekiller
- Simgeler için Görüntü Düzenleyicisi
.NET Desktop feedback