|
PDFsharp - moved to http://forum.pdfsharp.net/ Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
|
Important Notice:
We regret to inform you that our free phpBB forum hosting service will be discontinued by the end of June 30, 2024.
If you wish to migrate to our paid hosting service, please contact billing@hostonnet.com.
View previous topic :: View next topic |
Author |
Message |
phil.netring
Joined: 09 Sep 2008 Posts: 3
|
Posted: Wed Sep 10, 2008 3:03 pm Post subject: XImage from FileStream |
|
|
Hi Folks,
I've noticed a few people ask the question, How do I create a XImage from a FileStream? So here is the answer;
You can not create a XImage directly from the FileStream but you can create an XImage from a System.Drawing.Image (GDI+ Image) using the XImage.FromGdiPlusImage(Image) static method.
So, use System.Drawing.Image.FromStream(imageStream) to create your GDI+ Image object, and then use Ximage.FromGdiPlusImage(gdiPlusImage) to create you're XImage.
Example;
Code: |
System.IO.Stream imageStream = System.Net.WebRequest.Create(imagePath).GetResponse().GetResponseStream();
System.Drawing.Image systemImage = System.Drawing.Image.FromStream(imageStream);
XImage xImage = XImage.FromGdiPlusImage(systemImage); |
Hope this helps someone,
P. |
|
Back to top |
|
|
|
|
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 vote in polls in this forum
|
|