Professional Documents
Culture Documents
Membuat Aplikasi Paint Sederhana
Membuat Aplikasi Paint Sederhana
Membuat Aplikasi Paint Sederhana
Source codenya:
/*
* Created by SharpDevelop.
* User: DANI
* Date: 30/05/2015
* Time: 0:17
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace paint
{
/// <summary>
/// Description of MainForm.
/// </summary>
public partial class MainForm : Form
{
private Graphics paint;
private int ukuran = 5;
private int x1, y1, x2, y2, a,b;
private double luas;
private Boolean picture;
private int titik1 = 0, titik2 = 0;
private Color warna;
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
void MainFormLoad(object sender, EventArgs e)
{
paint = panel1.CreateGraphics();
}
void Panel1MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
picture = true;
}
x1 = e.X;
y1 = e.Y;
}
}
void Button5Click(object sender, EventArgs e)
{
warna = Color.Green;
}
void Button6Click(object sender, EventArgs e)
{
warna = Color.Black;
}
}
}