How do I write a .bmp file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bill Fuller

    #1

    How do I write a .bmp file

    I am creating a bitmap screen image using the following and would like to
    write it to a test.bmp file, but not sure how:

    Bitmap bm = new Bitmap(this.Wid th, this.Height);
    Graphics gr = Graphics.FromIm age(bm);
    gr.CopyFromScre en(this.Locatio n, new Point(0, 0), this.Size);

    QUESTION: How do I write this to a test.bmp file?


  • colin

    #2
    Re: How do I write a .bmp file


    "Bill Fuller" <someone@nospam .comwrote in message
    news:uXoo1xPxIH A.4560@TK2MSFTN GP03.phx.gbl...
    >I am creating a bitmap screen image using the following and would like to
    >write it to a test.bmp file, but not sure how:
    >
    Bitmap bm = new Bitmap(this.Wid th, this.Height);
    Graphics gr = Graphics.FromIm age(bm);
    gr.CopyFromScre en(this.Locatio n, new Point(0, 0), this.Size);
    >
    QUESTION: How do I write this to a test.bmp file?
    >
    bm.save("test.b mp",ImageFormat .Bmp);

    Colin =^.^=


    Comment

    • kimiraikkonen

      #3
      Re: How do I write a .bmp file

      On Jun 3, 1:03 am, "Bill Fuller" <some...@nospam .comwrote:
      I am creating a bitmap screen image using the following and would like to
      write it to a test.bmp file, but not sure how:
      >
      Bitmap bm = new Bitmap(this.Wid th, this.Height);
      Graphics gr = Graphics.FromIm age(bm);
      gr.CopyFromScre en(this.Locatio n, new Point(0, 0), this.Size);
      >
      QUESTION: How do I write this to a test.bmp file?
      As Colin stated, you must pass
      "System.Drawing .Imaging.ImageF ormat.Bmp" parameter in Save method.

      ..and also if you want to use additional encoding parameters, you need
      to pass "EncoderParamet ers" for features such as quality compression
      and color depth.

      Thanks,

      Onur Güzel

      Comment

      Working...