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
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
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.
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