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

Exporting CanvasViewer image

Hi,

I have a CanvasViewer with a number of layers on it (one that holds an image, another for text etc.).

Is there a way to export just one of layers as an image, for example only the image layer and not the text layer?

Thanks
Hello NormanL,

You can remove text layer (or any else) from canvas like this:

var textLayer = CanvasViewer.Canvas.Layers.GetLayersByName(textLayerName).FirstOrDefault();
if (textLayer != null)
	CanvasViewer.Canvas.Layers.Remove(textLayer);

float dpi = 96;
ColorSpace colorSpace = ColorSpace.Rgb;

Aurigma.GraphicsMill.Bitmap b = CanvasViewer.Canvas.RenderWorkspace(dpi, colorSpace);


I hope it helps.
Hi Vitaly,

Thanks. Hiding them works as well (as I may need to restore them).
NormanL,

Feel free to contact me if you have any additional questions.