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 817471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:59:58+00:00 2026-05-15T01:59:58+00:00

I am making a image editor kinda for own enjoyment and was wondering how

  • 0

I am making a image editor kinda for own enjoyment and was wondering how could I make a undo button to undo the last paints I did? I want to know how I would about this, a tutorial or sample code would be nice or at least something pointing me in the right direction.

Thanks!

  • 1 1 Answer
  • 2 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-05-15T01:59:59+00:00Added an answer on May 15, 2026 at 1:59 am

    heh undo in really non that hard as it sounds. The magic here that you should record each action as object which is painted in a list or queue, f.ex, user draws a line, so your record could look like x,y of start poing, and x,y of end point or object it self which have method Draw(), so what undo will do just remove that object.

    in code that could look something like this:

    interface IDrawObject
    {
         public void Draw();
    }
    
    class Line : IDrawObject
    {
        private Point _startP;
        private Point _endP;
    
        public Line(Point startPoint; Poing endPoint)
        {
            _startP = startPoint;
            _endP = endPoint;
        }
    
        public void Draw()
        {
            //* call some generic draw processor to perform the action with your given parameters.
        }
    }
    
    class Rectangle : IDrawObject
    {
        //* your code.
        public void Draw()
        {
             //* call some generic draw processor to perform the action with your given parameters.
        }
    }
    
    //* then in your code, you could have something like this.
    List<IDrawObject> myObjectsINeedToDraw = new List<IDrawObject>();
    myObjectsINeedToDraw.Add(new Line(new Point(0, 0), new Point(10, 10));
    
    foreach(IDrawObject objectToDraw in myObjectsINeedToDraw)
    {
        //* will draw your object.
        objectToDraw.Draw();
    }
    
    //* in this way you will have unlimited history of your objects, and you will always can remove object from that list.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making simple image editor by C# winform. I'm trouble with make zoom function.
i m making APP which do image proceesing using java SE.i want to check
I'm making an image gallery and I want to have a bunch of thumbnails
I am making an image editor (just a simple editor for a program I
I want to mask out part of an image on a page, making part
I'm making a simple image editor in VB.NET, and one of the functions is
im making an image button like this: <input type=image src=red.jpeg width=150px> but it is
I am making an image editing like program, and when I want to edit
I'm making some kind of image viewer/editor program, that would work on all the
I want to make a note editor. It will have an EditText with lines.

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.