如何将图像读取到流

时间:2012-09-25 05:31:23

标签: c# asp.net image-processing

  

可能重复:
  System.Drawing.Image to stream C#

 public static void SendHTMLEmail(Page p, string to, string subject, string content, System.Drawing.Image img)
        {
            MailMessage message = new MailMessage(); 
            message.IsBodyHtml = true;
            message.From = new MailAddress("myemail@gmail.com");

            message.To.Add(new MailAddress(to));

            //message.CC.Add(new MailAddress("carboncopy@foo.bar.com"));
            message.Subject = subject;
            message.Body = content;

            AlternateView htmlBody = AlternateView.CreateAlternateViewFromString(content, Encoding.UTF8, "text/html");

            Stream s = new MemoryStream();

            //s.re

            LinkedResource pic = img; (Cannot assign an image to pic)

由于pic需要一个流。我不知道如何将图像读取到流中。

请帮忙。

0 个答案:

没有答案