PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jun 30, 2024 7:29 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: XImage FromGdiPlusImage
PostPosted: Fri Jan 07, 2011 12:16 am 
Offline

Joined: Thu Jan 06, 2011 11:47 pm
Posts: 4
I'm evaluating PDFsharp as a replacement to our usage of Crystal Reports as the latter is simply too buggy and bloated.
So far things are looking VERY good! I have some System.Drawing.Bitmap objects in my C# application that I'm converting to XImage objects and placing on a PdfPage object. This is working well. I'm using the following code to do the conversion:
BitmapSource bitmapSource = Imaging.CreateBitmapSourceFromHBitmap(
myBitmap.GetHbitmap(),
System.IntPtr.Zero, System.Windows.Int32Rect.Empty,
BitmapSizeOptions.FromEmptyOptions());

XImage newImage = XImage.FromBitmapSource(bitmapSource);

However looking at the help, documentation, and source code to PDFsharp I think I should be able to do this simply like this:
XImage newImage = XImage.FromGdiPlusImage(myBitmap as Image);

The problem is FromGdiPlusImage does not appear as an available method for XImage. This is puzzling as I see it in the source code and the options GDI;UseGdiObjects are in fact defined in the solution when I build the resultant PdfSharp.dll which I'm referencing from my application.

I'm certainly doing something wrong?

Regards,
Dick


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 17, 2011 9:18 pm 
Offline

Joined: Thu Jan 06, 2011 11:47 pm
Posts: 4
This issue has been resolved.

I knew it would be something stupid I was doing.
The reference in my project was using the WPF version of the PDFsharp DLL instead of the GDI version.
Making the change fixed the problem.
At least I now know how to accomplish the same under either version now.

Dick


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 59 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group