Exporting View to Bitmap

Hi all,

I have a question. I am trying to export a GoView object into a Bitmap. I then use this bitmap for saving/printing purposes. However. just the exporting part does not get done at a satisfactory level.
I used:
MyObject : GoView, IGoControlObject
var bmp = myObjectInstance.GetBitmapFromCollection( myDocument, myDocument.Bounds, true );
bmp.Save(fileName, imageFormat);
This code produces a bitmap but the bitmap is very bad quality. The text within my GoObjects is not at all readable. I tried playing with the .SetRosolution(dpi) method. I didn't change anything at all.
Please help. Thanks.
Sido

What are the Bounds of the document?

It's a "document" (open for editing) that contains many GoObjects of all types. In my current instance, it just happened that my doc Bounds are:
{X = 0.0 Y = 0.0 Width = 2009.0 Height = 715.5}
Thanks
Size of that same instance is 2009 x 715.5
So the bounds seem to be valid when calling the method.

Quality gets alot worse as document gets bigger. 7000 x 21000 for example.

I tried different image formats (bmp, jpg, etc). Nothing helped.

OK, then. See this forum entry.



Also, PNG or BMP are the best formats. JPG is lossy, and GIF will dither if the colors aren’t exact.

Hi,
Thanks for ur feedback. Four more questions:
1) What are exactly the limits in terms if bitmap size? (any way around 2000 x 2000)?
2) I get no exceptions when I generate my bitmaps, no matter how big they are...... I just get them bad quality.......
3) Any workarounds?
4) Can we use vectorial type formats (metafiles for example?) as workaround?
Thanks
Sido
  1. Are you saying that if I export a bitmap image over the size of 32K by 32K pixels, it will “overflow” ??? Meaning if image is x by y, then x times y should not be over 1024 MEGA pixels???



    yes. It’s a GDI+ / architectural 32-bit limit.



    2) I get no exceptions when I generate my bitmaps, no matter how big they are… I just get them bad quality…



    3) What are those limits? And why are there limits?



    4) Any workarounds?



    The GetBitmapFromCollection with 3 parameters (the one you use above) limits the size of the Bitmap to 2000x2000 pixels. so, it is applying scaling for you.



    use GetBitmapFromCollection(IGoCollection coll, RectangleF bounds, float scale, bool paper)



    to get more control.

The scale overload is a workaround for exporting big bitmaps, but it still doesn’t fix the loss of quality we experience (text is not readable at all and shapes don’t look sharp).

Vector images (example Metafile object in .NET) seem to be much better quality than Bitmap object. Can we get vector images or Metafile objects exported from GoView? That should solve our problem.

You can export to SVG. See NodeLinkDemo.