This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Undo and Redo

Hi,

I am trying to add mask to my image, and I would like to make an undo and redo for it.

I tried those sample from the internet but still can't get it work. anyway could give me a better idea on it please? Thanks.

                _bmViewer.Bitmap.UndoRedoEnabled = False

                'Dim UserImage As Aurigma.GraphicsMill.Bitmap = _bmViewer.Bitmap

                Dim UserImage As New Aurigma.GraphicsMill.Bitmap(_bmViewer.Bitmap)

                Dim _item As Aurigma.GraphicsMill.WinControls.ThumbnailListItem
                _item = _thlMask.SelectedItems(0)

                Dim MaskImage As New Aurigma.GraphicsMill.Bitmap(_item.Pidl.Path)
                Dim resultImage As New Aurigma.GraphicsMill.Bitmap(UserImage.Width, UserImage.Height, Aurigma.GraphicsMill.PixelFormat.Format32bppArgb)

                ' Mask Preperation
                MaskImage.HorizontalResolution = UserImage.HorizontalResolution
                MaskImage.VerticalResolution = UserImage.VerticalResolution
                MaskImage.Transforms.Resize(UserImage.Width, UserImage.Height, Transforms.ResizeMode.Resize)
                If MaskImage.PixelFormat <> PixelFormat.Format8bppGrayScale Then
                    MaskImage.ColorManagement.Convert(PixelFormat.Format8bppGrayScale)
                End If

                resultImage.HorizontalResolution = UserImage.HorizontalResolution
                resultImage.VerticalResolution = UserImage.VerticalResolution
                resultImage.Transforms.Resize(UserImage.Width, UserImage.Height, Transforms.ResizeMode.Resize)


                resultImage = ManualCombine(UserImage, MaskImage)


                _bmViewer.Bitmap = resultImage
                _bmViewer.Bitmap.UndoRedoEnabled = True
                _bmViewer.Bitmap.SaveState()
                _btnUndo.Enabled = True
Hello,

I am afraid that it will be hard to help you having only this part of code. For example, I cannot find any Undo() or Redo() calls. Could you submit case with a complete sample project? I will do my best to assist you with this issue.
Hi,

The sample project is a bit too big to send via Email. I already upload the files to our webserver and emailed the URL detail to you. Please confirm. Thanks.
Hi,

OK, I have received the URL and downloaded the sample. I will answer you by email.
Okay. Thanks. Will be waiting for it...
Hi,

I have answered you by email. Please post here a line if you have not got the message.
Alex Kon
Hi,

I have answered you by email. Please post here a line if you have not got the message.


Thanks for the solution. It works great !!!