The MindFusion Forums | |
Flow Diagramming Components >> WPF >> Reset ZoomFactor in CreateImage
https://mindfusion.eu/Forum/YaBB.pl?num=1505198994 Message started by vremennyi on Sep 12th, 2017 at 6:49am |
Title: Reset ZoomFactor in CreateImage Post by vremennyi on Sep 12th, 2017 at 6:49am
I need to export diagram image at 100% size.
Diagram.CreateImage uses ZoomFactor from DiagramView and resizes all layers in diagram in the exported image. Reset ZoomFactor to 100 before exporting works only on small diagrams that fit in the View. Large diagrams are blurred during export. Is there a way to get a clear diagram image in 100% size? In addition it would be great if there is the way to export any Rect to image, i.e. Diagram.GetContentBounds() in default. Added export button to Demo project Code (html):
Code (c++):
|
Title: Re: Reset ZoomFactor in CreateImage Post by vremennyi on Sep 12th, 2017 at 7:04am
Without reseting ZoomFactor to 100% just getting transparent borders.
|
Title: Re: Reset ZoomFactor in CreateImage Post by Slavcho on Sep 12th, 2017 at 7:09am
Have you tried using the CreateImage(100) overload? I'll test it from the demo project.
|
Title: Re: Reset ZoomFactor in CreateImage Post by vremennyi on Sep 12th, 2017 at 7:12am Slavcho wrote on Sep 12th, 2017 at 7:09am:
CreateImage calls CreateImage(100) - same result. |
Title: Re: Reset ZoomFactor in CreateImage Post by Slavcho on Sep 12th, 2017 at 7:27am
Right, the exported boundaries are incorrect if the diagram is zoomed. Try calling UpdateLayout after resetting until we fix that -
[code] diagram.ZoomFactor = 100; diagram.UpdateLayout(); var image = diagram.CreateImage();[/code] |
Title: Re: Reset ZoomFactor in CreateImage Post by vremennyi on Sep 12th, 2017 at 8:14am
Main question about blurried images. See Attachment1.
Slavcho wrote on Sep 12th, 2017 at 7:27am:
It doesn't help) First diagram in Demo, same code + UpdateLayout Code (c++):
|
Title: Re: Reset ZoomFactor in CreateImage Post by Slavcho on Sep 12th, 2017 at 8:28am
I'm not seeing a blurred image after export, is your attachment the actual exported file or a screenshot of it in some application? What's the original zoom value when you click the export menu item? My export is attached, seems crisp enough.
|
Title: Re: Reset ZoomFactor in CreateImage Post by vremennyi on Sep 12th, 2017 at 8:45am Slavcho wrote on Sep 12th, 2017 at 8:28am:
Just downloaded Demo.CS again and added export menu item with same code again. Can't attach screencast, uploaded here: https://www.dropbox.com/s/mcmmwl7myr2febn/2017-09-12_13-40-48.mp4?dl=0 Online preview is blurried))) Watch downloaded. |
Title: Re: Reset ZoomFactor in CreateImage Post by Slavcho on Sep 12th, 2017 at 8:59am
Yes, I've reproduced when exporting a very large image. Our developer will investigate.
|
Title: Re: Reset ZoomFactor in CreateImage Post by Slavcho on Sep 12th, 2017 at 3:10pm
That seems a known problem with RenderTargetBitmap, e.g.
https://stackoverflow.com/questions/34745384/image-looks-blur-created-using-rendertargetbitamp-in-wpf Our guess is it could be related to max texture size of video card, WPF being backed by DirectX... We'll try to find some work-around. |
Title: Re: Reset ZoomFactor in CreateImage Post by Slavcho on Sep 13th, 2017 at 10:56am
This build glues the exported bitmap from smaller RenderTargetBitmaps, that seems to fix the blurry output -
https://mindfusion.eu/_beta/wpfdiag351.zip Also you should no longer have to set ZoomFactor. Regards, Slavcho |
The MindFusion Forums » Powered by YaBB 2.6.11! YaBB Forum Software © 2000-2024. All Rights Reserved. |