Saving image

Discussion in 'Programming & Scripting' started by Col2eight, Jun 30, 2009 with 2 replies and 187 views.

  1. Col2eight

    Col2eight Enthusiast

    Messages:
    74
    Ratings:
    1
    I know how to save an image off the internet, but not just a reflectionImage.....Can someone help me out? I know it's not a lotta info, but my saveFileDialog is renamed "s"

    lol..plz help me out. :tongue:


     
  2. dschu012

    dschu012 Enthusiast

    Messages:
    760
    Ratings:
    381
  3. OP
    Col2eight

    Col2eight Enthusiast

    Messages:
    74
    Ratings:
    1
    thx. i didn't quite use that code, I used this tho....

    Code:
                SaveFileDialog s = new SaveFileDialog();
    // Displays a SaveFileDialog so the user can save the Image
    // assigned to Button2.
    s.Filter = "png|*.png";
    s.Title = "Save achievement";
    s.ShowDialog();
    
    // If the file name is not an empty string open it for saving.
    if (s.FileName != "")
    {
    // Saves the Image via a FileStream created by the OpenFile method.
    System.IO.FileStream fs =
    (System.IO.FileStream)s.OpenFile();
    // Saves the Image in the appropriate ImageFormat based upon the
    // File type selected in the dialog box.
    // NOTE that the FilterIndex property is one-based.
    switch (s.FilterIndex)
    {
    case 1:
    this.pictureBox1.Image.Save(fs,
    System.Drawing.Imaging.ImageFormat.Png);
    break;
    
    }

    BUT, now I don't know how to combine both the textbox and pictureBox1...any help?
     

Share This Page