PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

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.
XImage from FileStream

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
phil.netring



Joined: 09 Sep 2008
Posts: 3

PostPosted: Wed Sep 10, 2008 3:03 pm    Post subject: XImage from FileStream Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com