Results 1 to 3 of 3

Thread: [RESOLVED] convert picturebox.image to stream

  1. #1

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Resolved [RESOLVED] convert picturebox.image to stream

    hi,
    how to convert picturebox.image to stream?

    popskie

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: convert picturebox.image to stream

    uh you asked a similar q in the other post. If you have an open stream and you want to save your image to that, Image.Save has an overloaded method that accepts a stream. As simple as that. For example:

    add this on top of the code page:
    using System.IO;
    Code:
    FileStream fs = File.Create("C:\\foo.jpg");
    pictureBox1.Image.Save (fs, System.Drawing.Imaging.ImageFormat.Jpeg);
    fs.Close();
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Re: convert picturebox.image to stream

    Mr Polite code is much easirer thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width