Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, December 29, 2009 7:40:39 AM(UTC)
davidanderson

Groups: Registered
Posts: 7


Do anyone knows?
 

Thanks
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, December 29, 2009 8:01:10 AM(UTC)
davidanderson

Groups: Registered
Posts: 7


By image operation I mean: Crop, resize, rotate etc.

[:)]
 
#3 Posted : Tuesday, December 29, 2009 10:39:25 AM(UTC)

Walter  
Walter

Groups: Tech Support
Posts: 366

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)

Hello,

There really isn't necessarily one distinct way to set this functionality up. It could vary from application to application exactly how it is implemented.

How many "undo" operations are you going to allow? Are you going to allow multiple redos?

If you're looking for a simple one step undo/redo system, you could simply save the current image to memory prior to processing it. If the user requests undo-ing the previous step, save the current image, and load the previous save. If they request a re-do, then load the current image that was saved. In short, keep a temp save, and swap them as necessary.

If you're looking to possible incorporate something more complex, the implementation will likely require at least one copy of the image, and a list of type Leadtools.ImageProcessing.RasterCommand. For "undo-ing" an operation, you could either simply save a copy of an image before running an command on it, and revert back to this upon request, or you could use the list of IRasterCommands you have to re-process the image from when it was loaded.

Depending on the number of commands that could take place, you may want to implement a system of temporary files, whereby every so often you'll save a file to revert back to if the user has to revert back many steps.

Regarding loading/saving, please refer to the .NET help file for use of one of the overloads for RasterCodecs.Load and RasterCodecs.Save. You could save to a memory stream or to the hard disk, depending on what type of implementation you want.
Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
#4 Posted : Tuesday, December 29, 2009 10:49:11 AM(UTC)
davidanderson

Groups: Registered
Posts: 7


I wish to have an infinite amount of undo/redo.

I am trying to save copies, but I'm having problems in undoing/redoing adding and removing pages.

=(
 
#5 Posted : Wednesday, December 30, 2009 12:53:15 PM(UTC)

Walter  
Walter

Groups: Tech Support
Posts: 366

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)

David,

I have posted a simple C# application that illustrates this concept here:
http://support.leadtools.com/SupportPortal/CS/forums/32265/ShowPost.aspx

The implementation uses two stacks instead of lists, as these seemed more appropriate.

If you have any questions or concerns regarding this, please let me know. Please explain in as much exactly any problems you're having so I can better assist you.
Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.131 seconds.