Image quality with SaveAsImage

 

Greetings,

We need to extract vector drawing from SolidEdge V20 into a raster tif image. We use the standard method: ActiveWindow.SaveAsImage It works, but the quality of the resulting image is very poor. I mean, sometimes for some images the graphics is fine, thin, but for others lines are too thick and overlapping, messing it up. Even at  high image resolution, lines are drawn thick. The resulting image looks similar to what is in SolidEdge, but it looks bad.

I understand that SolidEdge stores line thickness in device independed units, so it's not image resolution, it's something with the ratio of image size to line thickness width. How can we programmatically adjust line thickness or image size in physical unit's, or make SolidEdge to export image with more fine (thin) line graphics?

Also I'm going to try coping the image to metafile, the way I found at this forum, but I think it's more complex and less reliable.

Also a strange thing about the "bad" drawings is the message on opening:

"The assembly document cannot be found, therefore additional drawng views cannot be created and existing views cannot be updated....."

and I cannot select a distinct image element, line or arc on the drawing, although, using Solid Edge Spy (very useful tool) I can see some arcs and other objects under a Drawing View, not under Sheet itself. But I see no properties to set style, line width for Drawing View Drawing Objects, and cannot select them at the SE editor. What does it mean, is drawing view frozen, because a dependancy cannot be found, so I cannot update it's element's styles?

I really stuck on it, the current image quality is inacceptable. Please help

 

 

 

 

Posted by: Valeriy Romanov
Post date: 8/7/2008 7:07:56 AM

5 REPLIES

RE: Image quality with SaveAsImage

 

Another interesting thing, when we export the "bad" drawing to AutoCad and then produce tif, the quility is very good.

 

Posted by: Valeriy Romanov
Post date: 8/7/2008 8:52:26 AM

RE: Image quality with SaveAsImage

Need to see your code before I can help. Could you please reply with a snippet? What programming language?

 

Posted by: Jason Newell
Post date: 8/8/2008 4:44:53 AM

RE: Image quality with SaveAsImage

 

Thanks for your reply. Here is the code:

imageSheet.Activate();

SolidEdgeDraft.SheetWindow wndImageSheet = (SolidEdgeDraft.SheetWindow)documentAutoPtr.Application.ActiveWindow;

imageSheet.BackgroundVisible = true;

wndImageSheet.FitEx(SolidEdgeDraft.SheetFitConstants.igFitSheet);

wndImageSheet.SaveAsImage(

                    tmpFileName,

                    3000,

                    2000,

                    Missing.Value,

                    1,

                    SolidEdgeFramework.SeImageQualityType.seImageQualityHigh,

                    false);

I suppose line width is not scaled right with the image size. When I zoom, the image become thin and detailed, when SaveAsImage even at high image resolution, the lines are messed.

 

 

 

Posted by: Valeriy Romanov
Post date: 8/8/2008 5:17:27 AM

RE: Image quality with SaveAsImage

 

I don't think what you're trying to accomplish is going to work with the method you've chosen.  You need to read this post, specifically download and look at the CopyEMF.zip attachment.

Once you have the Metafile, you can save it to any image format the .NET supports.

Let me know if you have any questions.

 

Posted by: Jason Newell
Post date: 8/12/2008 8:03:29 PM

RE: Image quality with SaveAsImage

 

Thank you, I've downloaded the example and it works from the first try. But, as one could expect, the metafile without processing looks just the same, either there is no fine structure there, or (most probably) line thickness was preserved and lines are overlapped again. I know that it's already .NET/Windows stuff, but do you have an example of how can we try to set pen width for metafile and render it to tiff with thiner line width?

 

Posted by: Valeriy Romanov
Post date: 8/13/2008 8:20:11 AM