We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Cannot load image using paragraph.AppendPicture()

Thread ID:

Created:

Updated:

Platform:

Replies:

93826 Apr 6,2010 09:03 PM Apr 9,2010 12:40 AM Silverlight 2
loading
Tags: DocIO
Phuoc Nguyen
Asked On April 6, 2010 09:03 PM

Cannot load image using paragraph.AppendPicture(). Please help, thanks!

var imageData = "";
var paragraph = new Syncfusion.DocIO.DLS.WParagraph(document);
var logoBinary = System.Convert.FromBase64String(imageData);
paragraph.AppendPicture(logoBinary);

Error Message:
MM.SalesTools.Infrastructure.DocBuilderTests.DocBuilderTests.DocBuilder_GenerateDocumentTest threw exception: System.NullReferenceException: Object reference not set to an instance of an object..

Error Stack Trace:
Syncfusion.DocIO.DLS.WPicture.LoadImage(Byte[] imageBytes)
Syncfusion.DocIO.DLS.WParagraph.AppendPicture(Byte[] imageBytes)
...

Phuoc Nguyen
Replied On April 6, 2010 09:48 PM

Using AppendPicture(Stream imageStream) raise the following exception. Please help!

Error Message:
Test method MM.SalesTools.Infrastructure.DocBuilderTests.DocBuilderTests.DocBuilder_GenerateDocumentTest threw exception: System.TypeInitializationException: The type initializer for 'System.Windows.DependencyObject' threw an exception. ---> System.UnauthorizedAccessException: InvalidCrossThreadAccess.

Error Stack Trace:
MS.Internal.XcpImports.CheckThread()
System.Windows.DependencyObject..ctor(UInt32 nativeTypeIndex, IntPtr constructDO)
System.Windows.DependencyObject..ctor()
System.Windows.DependencyObject.ManagedReferencesToken..ctor()
System.Windows.DependencyObject..cctor()
System.Windows.DependencyObject..ctor(UInt32 nativeTypeIndex)
System.Windows.Media.Imaging.BitmapImage..ctor()
Syncfusion.DocIO.DLS.Entities.Image.ParsePngImage()
Syncfusion.DocIO.DLS.Entities.Image.Initialize()
Syncfusion.DocIO.DLS.Entities.Image..ctor(Stream stream)
Syncfusion.DocIO.DLS.WPicture.LoadImage(Stream imageStream)
Syncfusion.DocIO.DLS.WParagraph.AppendPicture(Stream imageStream)
...

Poornima R [Syncfusion]
Replied On April 9, 2010 12:40 AM

Hi Phuoc,

Sorry for the long delay in getting back to you.

We have prepared the sample for your requirement.Could you please find the samlpe from the below. Try running the sample and let us know if this helps.If still the issue exist, Could you please provide us with the entire sample you are using to reproduce ths issue.So that we can analyse the issue and provide you with clear details.

Sample link:
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=F938262054369625.zip

Please let us know if you have any queries.

Regards,
Poornima

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;