ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Undo
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

pierrotsc

USA
497 Posts

Posted - Jul 22 2015 :  07:43:56  Show Profile  Reply
Is there a way to undo a stream of commands like the ones below?
ImageEnVect.Proc.SaveUndo;
{ Merge vectorial objects with the background image }
ImageEnVect.CopyObjectsToBack(Antialias.Checked,
AdaptBitmapPixelFormat.Checked);

ImageEnVect.RemoveAllObjects;
ImageEnVect.Update;

Thanks.
Pierre

w2m

USA
1990 Posts

Posted - Jul 22 2015 :  12:11:31  Show Profile  Reply
TImageEnVect.ObjUndoMode

Declaration

property
ObjUndoMode: TIEVUndoMode;

Description

This property allows you to share the Undo/Redo system between image processing and vectorial objects. The default value (ieumSeparated) separates the two systems.

Example


ImageEnVect1.ObjUndoMode := ieumShared;
ImageEnVect1.ObjAutoUndo := true;
ImageEnVect1.Proc.UndoLimit := 10;

From now you can do Undo of image processing or vectorial objects just calling:

ImageEnVect1.Proc.Undo;
ImageEnVect1.Proc.ClearUndo;

otherwise if ObjUndoMode is ObjUnmSeparated then both ObjSaveUndo, Proc.SaveUndo and ObjUndo, Proc.Undo and ObjClearUndo, Proc.ClearUndo must be used.

Set ObjUndoMode := ieumShared then Proc.Undo, changes both the processing changes and any object changes.

A small demo will be posted to the users section.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Jul 22 2015 :  12:34:23  Show Profile  Reply
Thanks Bill. I was not aware of the mode.
Now, would the undo command undo 2 commands one after another in one time?
I am doing a copyobjectstoback and a removeall objects.

Where can I find the user's area for the demo?
Thanks.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jul 22 2015 :  12:57:15  Show Profile  Reply
Yes. One click on undo, undo's both. You may get the demo here: http://www.xecute.com/ieforum/topic.asp?whichpage=2.95&TOPIC_ID=1446#8175

If you have an old version of ImageEn this featurte may not be present, in which case you must use both ObjUndo and Proc.Undo functions. See the help file. It is highly recommended that ImageEn is kept up-to-date.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Jul 22 2015 :  14:04:26  Show Profile  Reply
Thanks Bill. Your demo works fine but not my code :(
When i undo, the box comes back but when i move it, the raster image of the box is still there. Not in your demo though..

Will try to find out what is wrong.
Pierre
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Jul 22 2015 :  14:18:35  Show Profile  Reply
Bill, i am emailing you a modified project. Create a box, merge it and undo. Move the box and you will see the box bitmap still there. If you do not get it in a few, i may have an old email address.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jul 22 2015 :  14:20:38  Show Profile  Reply
the email is just below my name in the post.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jul 22 2015 :  14:26:47  Show Profile  Reply
Pierre,

You are using an older version of ImageEn than I am using. When I compile your project here it works as expected.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Jul 22 2015 :  14:36:02  Show Profile  Reply
When i tried your demo originally, it worked fine. No problem. I made some modifications and it behaves like mine.
Let me reload your original source code again..And try it..

Thanks.
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Jul 22 2015 :  14:41:34  Show Profile  Reply
Yep, your demo works fine. There is something i am modifying that makes the bitmap stay. I'll troubleshoot.
Thanks.
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Jul 22 2015 :  15:05:54  Show Profile  Reply
Got it..When in your demo I changed in the imageenvect component the objundomode property to shared instead of separated, it then left the bitmap after the undo.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jul 22 2015 :  15:09:47  Show Profile  Reply
You should be using ieumSeparated in order to use ImageEnVect1.Proc.Undo. See the simplified version I emailed you.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Jul 22 2015 :  15:12:40  Show Profile  Reply
Got it. I guess i got confused. I thought i had to use ieumShared to use proc.undo for both vector and bitmap.

Let me look at your demo.
Thanks.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jul 22 2015 :  15:19:33  Show Profile  Reply
No you are correct... it should be ieumShared ... you got me confused.
procedure TForm1.FormCreate(Sender: TObject);
begin
  ImageEnVect1.ObjUndoMode := ieumShared;
  ImageEnVect1.ObjAutoUndo := False;
  ImageEnVect1.ObjUndoLimit := 10;
  IERegisterFormats;
  OpenPictureDialog1.Filter := GraphicFilter(TGraphic);
end;

The simpler demo uses ieumShared!

If the simple demo sent by email does not work as is then you should update ImageEn. What version are you using anyway?

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Jul 22 2015 :  15:25:14  Show Profile  Reply
Bill, give me a few mn to look at your new demo. Something just came up :)
I'll get back to you..

I am using 5.0.2
Pierre
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jul 22 2015 :  15:27:40  Show Profile  Reply
5.0.2 version is old.... try at least 6.0.1. that is what I am using. There have been a lot of changes between 5 and 6...

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Jul 22 2015 :  15:38:22  Show Profile  Reply
Ok...When i click undo, it clears everything in the new demo. The old works ..Let me play with it..
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: