Generating High Resolution Images

13 views
Skip to first unread message

Nick Cipollina

unread,
Jan 23, 2014, 3:15:19 PM1/23/14
to dot-net-...@googlegroups.com
Hello,

I am trying to generate images in a pdf and am having difficulty when doing so with high resolution images.  The definition for the image is pretty straightforward:

<Image Width="72" Height="72" Source="Image1"/>

and in the GetImageDelegate delegate I have the following to return the image Stream:

return new LocalResource(images[0].ImageUri).GetDataAsync().Result;

where LocalResource is similar to the PackageResource class that is provided in the sample project.  When the image is a low-res image it renders just fine in the pdf but when it is a high-res image it doesn't render at all.  

Any ideas what I need to do?

Thanks in advance,

Nick

siberix

unread,
Jan 23, 2014, 4:37:33 PM1/23/14
to dot-net-...@googlegroups.com
Hi Nick,

It is hard to tell based only on the available information, but i have a couple of guesses there:

1. Please make sure your LocalResource returns a valid stream with the data. Make sure that the length of the stream is equal the length of the original image data.

2. It might be a problem of the image format that is not supported by WinRT framework. To check if this is the case please try to create a separate Siberix.Graphics.Image object passing the stream from your LocalResource and check if the width and height of the image are equal to the width and height of your original image and that they are not equal to 0.

3. Try to re-save / convert the original image into different format. It might be stored in the JBIG2 or some other format which is not supported by Report Writer, so try to convert it to basic JPG or PNG (just for test).

4. It might be a problem of async / await calls in the code. The image data is loaded asynchronously, but please make sure that all of the data is loaded by the time when you generate the PDF document.

Thank You,
Victor
Reply all
Reply to author
Forward
0 new messages