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

Notification

Icon
Error

Options
Go to last post Go to first unread
czyzer  
#1 Posted : Sunday, February 13, 2005 4:41:00 AM(UTC)
czyzer

Rank: Member

Groups: Guest
Joined: 2/13/2005(UTC)
Posts: 1

When using Remote Scripting to call Bitmap.Undo I get the following exception:

Unable to restore object state due to UndoRedoEnabled property value is false.

I've set the UndoRedoEnabled property of the Bitmap to true in the PageLoad. After each transformation I use the SaveState method. Whenever the Undo remote scripting method is called the UndoRedoEnabled boolean of the Bitmap seems to be reset to false.

Can anybody help me out, maybe I'm doing something wrong.... Here's my code behind code.


Code:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Aurigma;
using Aurigma.GraphicsMill;
using Aurigma.GraphicsMill.WebControls;

namespace TestingIt
{
	/// <summary>
	/// Summary description for WebForm1.
	/// </summary>
	public class WebForm1 : System.Web.UI.Page
	{
		protected Aurigma.GraphicsMill.WebControls.RectangleRubberband RectangleRubberband1;
		protected System.Web.UI.WebControls.Button BtnUndo2;
		protected Aurigma.GraphicsMill.WebControls.BitmapViewer BitmapViewer1;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			if (!this.IsPostBack)
			{
				BitmapViewer1.Bitmap.UndoRedoEnabled = true;
				BitmapViewer1.Bitmap.Load(Server.MapPath("/TestingIt/UploadedImages/MeltDown.jpg"));
				BitmapViewer1.Bitmap.SaveState();
			}
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{    
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		[RemoteScriptingMethod]
		public void Crop(int Top, int Left, int Width, int Height)
		{
			BitmapViewer1.Bitmap.Transforms.Crop(Top, Left, Width, Height);
			BitmapViewer1.Bitmap.SaveState();
		}

		[RemoteScriptingMethod]
		public void Rotate(int Degrees)
		{
			BitmapViewer1.Bitmap.Transforms.Rotate(Degrees);
			BitmapViewer1.Bitmap.SaveState();
		}

		[RemoteScriptingMethod]
		public void AdjustBrightness(float BrightnessAmount, float ContrastAmount)
		{
			BitmapViewer1.Bitmap.ColorAdjustment.BrightnessContrast(BrightnessAmount,ContrastAmount);
			BitmapViewer1.Bitmap.SaveState();
		}

		[RemoteScriptingMethod]
		public void Resize(int Width, int Height)
		{
			BitmapViewer1.Bitmap.Transforms.Resize(Width,Height);
			BitmapViewer1.Bitmap.SaveState();
		}

		[RemoteScriptingMethod]
		public void Undo()
		{
			try
			{
				BitmapViewer1.Bitmap.Undo();
			}
			catch(System.Exception ex)
			{
				Console.WriteLine(ex.Message);
			}
		}

		[RemoteScriptingMethod]
		public void Redo()
		{
			BitmapViewer1.Bitmap.Redo();
		}
	}
}



Thanks

-Rich






Edited by user Monday, December 24, 2007 4:12:44 PM(UTC)  | Reason: Not specified

Fedor  
#2 Posted : Sunday, February 13, 2005 12:50:00 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Guest
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
Hello Rich,

We confirm the problem. It will be fixed in next release which will be in the begining of March.
Best regards,
Fedor Skvortsov
Fedor  
#3 Posted : Wednesday, June 1, 2005 10:28:00 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Guest
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
This problem was finally fixed in upcoming version 3.1 which will be available in the nearest day.
Best regards,
Fedor Skvortsov
Users browsing this topic
Guest
Forum Jump  
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.