Forma mouse ile resim çizme (Paintteki kalem aracı) –Csharp

Forma mouse ile resim çizme (Paintteki kalem aracı) –Csharp


Not : Forma resim çizimi sağlar.Renk mavi olarak ayarlamıştır.Renk kodunu istediğiniz renge ayarlayabilirsiniz. Painteki kalem aracı ile aynı işlevi yapar.

 

resim_ciz

 

[code lang=”csharp”]

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;//www.gorselprogramlama.com/
using System.Windows.Forms;

namespace resim_islemleri
{

public partial class Form1 : Form
{
bool islem = false;
public Form1()
{
InitializeComponent();
}//www.gorselprogramlama.com/

private void Form1_Load(object sender, EventArgs e)
{

}

private void Form1_MouseMove(object sender, MouseEventArgs e)
{
if (islem)
{
Graphics graphics = CreateGraphics();
graphics.FillEllipse(new SolidBrush(Color.BlueViolet), e.X, e.Y, 4, 4);
graphics.Dispose();
}
}

private void Form1_MouseUp(object sender, MouseEventArgs e)
{
islem = false;
}

private void Form1_MouseDown(object sender, MouseEventArgs e)
{
islem = true;
}
}//www.gorselprogramlama.com/
}

[/code]

 

resim_ciz2

Projeyi İNDİR

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir