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 question
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

pierrotsc

USA
499 Posts

Posted - Jan 12 2015 :  15:10:51  Show Profile  Reply
Can this statement be undone with the Undo command? I cannot make it work.

Mainform.ImageEnVect.IEBitmap.Assign(ImageEnView1.IEBitmap);

Thanks.
Pierre

xequte

39140 Posts

Posted - Jan 12 2015 :  18:05:46  Show Profile  Reply
Hi Pierre

No assignment is not automatically handled by undo. You would need to manually add it to the undo stack:

http://www.imageen.com/help/TImageEnProc.SaveUndo.html


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

pierrotsc

USA
499 Posts

Posted - Jan 12 2015 :  18:36:38  Show Profile  Reply
This is what i have and it is not undoing:
// Undo
Mainform.ImageEnVect.Proc.ClearAllRedo;
Mainform.ImageEnVect.Proc.SaveUndoCaptioned
('Apply Filter ' + IntToStr(Mainform.ImageEnVect.Proc.UndoCount));
Mainform.Undo_Btn.Hint := 'Apply ' +
IntToStr(Mainform.ImageEnVect.Proc.UndoCount + 1);
Mainform.ImageEnVect.Proc.SaveUndo(ieuImage);
Mainform.ImageEnVect.IEBitmap.Assign(ImageEnView1.IEBitmap);
Mainform.ImageEnVect.Update;

The undo button has this code:
with ImageEnVect.Proc do
begin
SaveRedoCaptioned(UndoCaptions[0], ieuImage); // saves in Redo list
Undo;
ClearUndo;
end;
refreshUndoButtons;

When i do that, I get a blank image and not the original one i had before the assign command.
Thanks for the help.
Pierre
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jan 12 2015 :  18:50:01  Show Profile  Reply
You are saving the undo twice...
Mainform.ImageEnVect.Proc.SaveUndoCaptioned
Mainform.ImageEnVect.Proc.SaveUndo(ieuImage)

Only save the undo one time...

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
499 Posts

Posted - Jan 13 2015 :  10:54:14  Show Profile  Reply
I found out why and i do not understand why the image becomes blank when i undo.

I had to comment these 2 statements that were located before the saveundo:
Mainform.ImageEnVect.clear;
Mainform.ImageEnVect.LayersClear;

My questions is why these 2 statements affect the saveundo? They are located before the command.
Thanks.
Pierre
Go to Top of Page

xequte

39140 Posts

Posted - Jan 13 2015 :  13:20:28  Show Profile  Reply
HI Pierre

Is AutoUndo disabled?

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

pierrotsc

USA
499 Posts

Posted - Jan 13 2015 :  13:41:01  Show Profile  Reply
It is indeed set to false.Is that ok?
Go to Top of Page

xequte

39140 Posts

Posted - Jan 13 2015 :  21:17:37  Show Profile  Reply
Hi

Can you send us a small demo that shows the problem.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

pierrotsc

USA
499 Posts

Posted - Jan 14 2015 :  14:10:24  Show Profile  Reply
It may be hard but i may try to extract some lines and create a small program over the week-end.
Thanks.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: