This is a migrated thread and some comments may be shown as answers.

Why the export image fuzzy in high resolution?

5 Answers 167 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 23 Jun 2017, 09:43 AM

Hi, I hava a diagram, and want to export. The code is as follows:

FileStream fs = File.Open("D:\\a.png", FileMode.Create);
pair.Diagram.Zoom = 1;
pair.Diagram.ExportToImage(fs, null, new Rect(minX, minY, ww, hh));
fs.Close();

Now, the problem is that the exported image a.png is clear in my notebook PC(Screen resolution:1366*768). But it is fuzzy in my friend's(Screen resolution:1920*1080) by using the same code.
Why? Hope answer, thanks. 

5 Answers, 1 is accepted

Sort by
0
Jonathan
Top achievements
Rank 1
answered on 26 Jun 2017, 10:33 PM
Sorry, I forgot to say the diagram contains a image, and the image is fuzzy.
0
Dinko | Tech Support Engineer
Telerik team
answered on 28 Jun 2017, 08:44 AM
Hello Jonathan,

Thank you for contacting us.

We weren't able to reproduce this behavior. That is why we would ask you to send us isolated project from your application reproducing the behavior explained in your post. This way we can directly test it on our side.

We are looking forward to your reply.

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Jonathan
Top achievements
Rank 1
answered on 04 Jul 2017, 07:17 AM

Hello, Dinko.

Thanks for your reply. I make a example VS project to reproduct the problem. The link is follow:

http://www.filefactory.com/file/1ff619gqai6d/ExportDiagramdemo.zip

Run the program, and click [test-export to image] menu on the top, you can find a tt.png in 'D:\\'. Run the program in different PC and resolution to see problem.

The diagram contains a image. For diagram load fast, I make the image out of the diagram xml file.

Hope your reply, thanks.

0
Accepted
Dinko | Tech Support Engineer
Telerik team
answered on 06 Jul 2017, 02:28 PM
Hi Jonathan,

Thank you for the provided project.

You can try to increase the DPI settings of the exported image. The default value is set to 96d. Keep in mind that setting this attribute will increase your memory usage.
private void MenuItem_Click(object sender, RoutedEventArgs e)
{
    FileStream fs = File.Open("D:\\\\tt.png", FileMode.Create);
    this.diagram.ExportToImage(fs,null,null,new Size(0,0),new SolidColorBrush(Colors.White),new Thickness(1), 192d);
    fs.Close();   
}

If your diagrams are going to be very large (i.e. 10000px+) you should really take a look at exporting to PDF instead of PNG as it will be much more efficient memory wise and look better. The ExportUIElement SDK example in our GitHub repository is a great place to start: 

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
Jonathan
Top achievements
Rank 1
answered on 11 Jul 2017, 05:51 AM
Thank you Dinko. It works very well.
Tags
Diagram
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Jonathan
Top achievements
Rank 1
Dinko | Tech Support Engineer
Telerik team
Share this question
or