Upload presentasi
Presentasi sedang didownload. Silahkan tunggu
Diterbitkan olehWidyawati Susanto Telah diubah "7 tahun yang lalu
1
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
COMPUTER GRAPHICS D10K-5C01 GK02b: Menggambar Objek Grafis Menggunakan C#.NET Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
2
Pengantar Framework internal Visual Studio: GDI+
Komponen dalam windows diibaratkan sebuah kanvas Aplikasi grafis mengambar objek grafis dalam kanvas tersebut
3
Listing 1
4
Langkah-langkah Buka Visual Studio
Buat proyek baru, type proyek Windows Form Pada property form pilih even Paint
5
Even handler Paint private void Form1_Paint(object sender, PaintEventArgs e) { Font fon = new Font("Verdana", 10); Color merah=Color.Tomato; Brush kwas = new SolidBrush(merah); Graphics grafik = e.Graphics; Point lokasi = new Point(10, 10); grafik.DrawString("Saya belajar GDI+",fon,kwas,lokasi); }
6
Even handler Paint
7
Shapes dalam GDI C# Rectangle Filled Rectangle Line Ellipse
FilledEllipse Pie FilledPie Polygon FilledPolygon
8
Rectangle DrawRectangle (System.Drawing.Pen, float x, float y, float width, float height) g.DrawRectangle (new Pen(Color.Pink,3), 15,15,200,150);
9
FilledRectangle FillRectangle(System.Drawing.Brush, float x, float y, float width, float height) g.FillRectangle (new SolidBrush(Color.Pink), 20,20,160,50);
10
Line DrawLine(System.Drawing.Pen, float x, float y, float width, float height) g.DrawLine(new Pen(Color.Pink,3),15,15,200,150);
11
Ellipse DrawEllipse(System.Drawing.Pen, float x, float y, float width, float height) g.DrawEllipse(new Pen(Color.Pink,3), 15,15,200,150);
12
FilledEllipse FillEllipse(System.Drawing.Brush, float x, float y, float width, float height) g.FillEllipse (new SolidBrush(Color.Pink), 20,20,160,50);
13
Pie DrawPie(System.Drawing.Pen, float x, float y, float width, float height) g.DrawPie(new Pen(Color.Black),160,30,150,170,100,110)
14
FilledPie FillPie(System.Drawing.Brush, float x, float y, float width, float height) g.FillPie(new Brush(Color.Black),160,30,150,170,100,110)
15
Polygon DrawPolygon(System.Drawing.Pen, new Point[] { new Point(x,y), new Point(x,y), new Point(x,y), new Point(x,y), new Point(x,y), new Point(x,y)}); g.DrawPolygon(new Pen(Color.Red,2), new Point[] { new Point(130,140), new Point(165,200), new Point(100,225), new Point(190,190), new Point(50,330), new Point(20,180)});
16
FilledPolygon FillPolygon(System.Drawing.Brush, new Point[] { new Point(x,y), new Point(x,y), new Point(x,y), new Point(x,y), new Point(x,y), new Point(x,y)}); g.FillPolygon(new Brush(Color.Red), new Point[] { new Point(130,140), new Point(165,200), new Point(100,225), new Point(190,190), new Point(50,330), new Point(20,180)});
Presentasi serupa
© 2024 SlidePlayer.info Inc.
All rights reserved.