Image Resolution Issue

Mar 31, 2011 at 4:29 PM

I am using ImageTools to save a controls contents to an image.  It is working great but the image quality is very poor.  Let me explain.

I have two canvases stacked.  The top canvas is clipped and acts as a viewport to the underlying canvas.  The underlying canvas is the canvas where objects are drawn and transforms are applied.  Currently, the image I am saving is of the viewport where the contents of the underlying canvas have been scaled and translated to fit the viewport.  The image comes out but since the contents were scaled the quality is rather poor.  You can't zoom in to the image without immediately losing quality.

I tried attempting to save the underlying canvas as an image but it is either blank or only shows a very small portion of what should be captured.  This is because the canvas itself is very small and most the objects are not even on it after the scale and translate transform have been applied.  Is there a way I can do this with ImageTools.  I tried creating a WriteableBitmap using the RenderTransform of that underlying canvas and then using IMageTools.  The image created looks like a goodf enough quality but it is only the size of the underlying canvas itself (which is way too small).  I need to somehow ensure that the resulting image is enlarged to the full size and I am not sure how to do this.

Apr 15, 2011 at 12:22 PM

When you created an writeable bitmap you can define a transform. You can probably use a ScaleTransform to make the resulting image larger.

Apr 15, 2011 at 12:58 PM

That's what I tried to do.  That is what I was talking about when I said "using the RenderTransform".  I only ended up with a zoomed in section of what I was capturing.  The image looked good but it was only partial.  I wasn't sure if I needed to change some properties on the ImageTools side to get it to work correctly.  I can't find an example on doing things this way.