none
render image

    Question

  • I have this code to convert to tiff the canvas content,

    visual =

    new DrawingVisual();
    context = visual.RenderOpen();
    elementBrush =
    new VisualBrush(element);
    context.DrawRectangle(elementBrush, null, new Rect(0, 0, tam.Width, tam.Height));
    context.Close();
    res =
    new RenderTargetBitmap(tam.Width, tam.Height, 300, 300, format);
    res.Render(visual);

    the canvas has an image of resolution 300 and size 1916x1916, the problem is that when I execute the line
    res = new RenderTargetBitmap(tam.Width, tam.Height, 300, 300, format);
    cut me the image, for I can get the totally image i have to put resolution to 96,96, how can i do it for get the totally imagen in resolution 300 and don't change me the image size?

    thanks, Oscar

    Tuesday, November 17, 2009 9:15 AM

Answers