http://www.ourfly.com/forum/View.aspx?fbId=7&Id=313

解决方案 »

  1.   

    能讲讲怎么样存成二进制文件吗?
    我一直很关注这个问题,只是在.net中不知道如何做?
      

  2.   

    public class ValidationImage 

      private Bitmap m_Image; 
      private string m_Text;   public ValidationImage(string Text, Font font, Color ForeColor, Color BackgroundColor) 
      { 
        // Create a bitmap so we can create the Grapics object 
        Bitmap bm = new Bitmap(1,1); 
        Graphics gs = Graphics.FromImage(bm);     // Resize the bitmap so the width and height of the text 
        bm = new Bitmap(Convert.ToInt32(gs.MeasureString(Text, font).Width),Convert.ToInt32(gs.MeasureString(Text, font).Height));     // Render the bitmap 
        gs = Graphics.FromImage(bm); 
        gs.Clear(BackgroundColor); 
        gs.TextRenderingHint = TextRenderingHint.AntiAlias; 
        gs.DrawString(Text, font, new SolidBrush(ForeColor), 0, 0); 
        gs.Flush();     // Set the properties 
        m_Image = bm; 
        m_Text = Text; 
      }   // Public Properties 
      public Bitmap Image { 
        get { return m_Image; } 
      }   public string Text { 
        get { return m_Text; } 
      } 
      

  3.   

    see
    File Upload with ASP.NET
    http://www.codeproject.com/aspnet/FileUpload.asp
      

  4.   

    byte[] bytes = ... //从数据库读出二进制内容,也就是图片内容

    string fn = Server.MapPath(@"/1.jpg");
    System.IO.FileStream fs=new System.IO.FileStream(fn,FileMode.Create,FileAccess.Write);
    fs.WriteByte(bytes); //生成文件
    fs.Flush;
    fs.Close();Response.Redirect("/1.jpg");
      

  5.   

    从数据库中读出二进制图片,可以制成缩略图吗?可以的话,请教楼上如何操作,在web下面
      

  6.   

    Image o = //图像
    o.GetThumbnailImage(宽,高,null,IntPtr.Zero);