Welcome Guest! You need to login or register to make posts.



Go to last post Go to first unread
#1 Posted : Saturday, May 1, 2010 9:07:31 PM(UTC)

Rank: Newbie

Groups: Member
Joined: 1/9/2010(UTC)
Posts: 7


how should I save the complete edited image - in the gift editor sample.

I would prefer simply to save it as a new image - but I am not sure that is possible?

I have tried to serialize the canvas - but when i deserialize the getRegions() in the photoLabelControl.ascx fails

yield return new NamedRectangleRegion(l.Name, new RectangleF(l.Region.Left, l.Region.Top, l.Region.Width, l.Region.Height));



{"Object reference not set to an instance of an object."}

It seems as if the layer (__backgroundImageLayer) has no regions?

Any idea what is happening - or should i use a different way to save the complete image ?

best regards


Edited by moderator Monday, May 28, 2012 8:51:48 PM(UTC)  | Reason: Not specified

#2 Posted : Monday, May 3, 2010 1:03:46 PM(UTC)

Rank: Advanced Member

Groups: Member
Joined: 6/16/2009(UTC)
Posts: 134

Was thanked: 8 time(s) in 8 post(s)
Hi Claus!

We have the RenderRegion method in the PhotoLabelControl.aspx.cs which allows to get every region as bitmap. To save the whole canvas as bitmap you can add new public method in the PhotoLabelControl.aspx.cs. There is the code snippet for this method below:


	public Aurigma.GraphicsMill.Bitmap RenderCanvas(float dpi)
		Layer _regionLayer = this.CanvasViewer.Canvas.Layers.GetLayersByName(_regionLayerName)[0];
		// Hide layer with region's rectangles.
		_regionLayer.Visible = false;
		Bitmap bp = this.CanvasViewer.Canvas.RenderWorkspace(dpi, Aurigma.GraphicsMill.ColorSpace.Rgb);
		// Show regions layer back.
		_regionLayer.Visible = true;

		return bp;

To save bitmap as an image file use Save method:


	protected void renderBtn_Click(object sender, EventArgs e)
		using (Bitmap bp = photoLabel.RenderCanvas(300))

And yes, there is an error occurs while canvas deserialization. We will fix it.

Users browsing this topic
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.