1 Replies - 1529 Views - Last Post: 11 December 2012 - 01:36 AM Rate Topic: -----

#1 ogadit  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 31-July 12

Problem with paint in C#

Posted 11 December 2012 - 01:26 AM

Hey Guys,
This is My First Topic.
My Code is the following :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Paint
{
    public partial class Form1 : Form
    {
        bool paint = false;
        int size = 2;
        SolidBrush brush;
        public Form1()
        {
            InitializeComponent();
        }

        private void trackBar1_Scroll(object sender, EventArgs e)
        {
            size = slideSize.Value;
        }

        private void btnClear_Click(object sender, EventArgs e)
        {
            paintArea.CreateGraphics().Clear(paintArea.BackColor);
        }

        private void paintArea_MouseUp(object sender, MouseEventArgs e)
        {
            paint = false;
        }

        private void paintArea_MouseDown(object sender, MouseEventArgs e)
        {
            paint = true;
            brush = new SolidBrush(colorDialog1.Color);
            paintArea.CreateGraphics().FillEllipse(brush, e.X, e.Y, size, size);
            paintArea.CreateGraphics().Dispose();
        }

        private void paintArea_MouseMove(object sender, MouseEventArgs e)
        {
            if (paint)
            {
                brush = new SolidBrush(colorDialog1.Color);
                paintArea.CreateGraphics().FillEllipse(brush, e.X, e.Y, size, size);
                paintArea.CreateGraphics().Dispose();
            }
        }

        private void btnColor_Click(object sender, EventArgs e)
        {
            colorDialog1.ShowDialog();
        }
    }
}


I am asking how to make the drawing smoother bcuz when i draw there are small dots & how to save this picture which i make in png and jpg AND also how to add text??

Is This A Good Question/Topic? 0
  • +

Replies To: Problem with paint in C#

#2 Michael26  Icon User is offline

  • DIC-head, major DIC-head
  • member icon

Reputation: 362
  • View blog
  • Posts: 1,537
  • Joined: 08-April 09

Re: Problem with paint in C#

Posted 11 December 2012 - 01:36 AM

Do you need something like this?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1