ChingYen#8610
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.
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