Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8942573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:32:48+00:00 2026-06-15T11:32:48+00:00

For graphics exercises and some self-improvement sorta stuff, i’ve decided to basically just mess

  • 0

For graphics exercises and some self-improvement sorta stuff, i’ve decided to basically just mess around and try and recreate some of the functionality of paint within a winform. I’ve got a lot of the standard ones to work, for example paint can, drawing dots around the cursor, free hand draw and what not, however i’m a little puzzled as to how paint does the mid-drawing animations. For example;

To draw a simple line i can simply get mouse coordinates on MouseUp and MouseDown events, and use the graphics class to draw a line between the two.

However, on MSpaint whilst drawing a line, you get almost a “preview” of the line after you click the first point, and whilst dragging it to the second point the line follows your cursor, but i’m a little stuck as to how this would be done? Does it involve constant redrawing of the line and the graphics device? It’d be great if someone could give me some hints / inner knowledge, i’ve had a search around the internet but can’t REALLY find anything of use..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:32:49+00:00Added an answer on June 15, 2026 at 11:32 am

    And very modern via ControlPaint.DrawReversibleLine method 🙂

    Point? startPoint;
    Point? endPoint;
    
    private void Form_MouseDown(object sender, MouseEventArgs e)
    {
        startPoint = PointToScreen(e.Location);
    }
    
    private void Form_MouseMove(object sender, MouseEventArgs e)
    {
        if (!startPoint.HasValue)
            return;
    
        if (endPoint.HasValue)
            ControlPaint.DrawReversibleLine(startPoint.Value, endPoint.Value, Color.White);
    
        endPoint = PointToScreen(e.Location);
        ControlPaint.DrawReversibleLine(startPoint.Value, endPoint.Value, Color.White);
    }
    
    private void Form_MouseUp(object sender, MouseEventArgs e)
    {
        startPoint = null;
        endPoint = null;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple graphics application which draws some stuff on the screen. Before,
Just tried some small graphics application of mine on Windows 7, and I'm getting
I'm doing some graphics programming using the Gosu gem. The thing is, when I
For some graphics work I need to read in a large amount of data
I'm drawing some graphics and text with GDI in my CScrollView. I need to
I have some graphics of size in inches: 4.25 x 6.875 5.5 x 8.5
I've just started graphics programming in Ogre, and just can't understand why there is
I've gotten some graphics files for buttons etc. from the designer. Most of the
To get some smooth graphics, I want to draw oversampled by factor 2 and
For some very sophisticated graphics I am thinking about making a fontset out of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.