Wednesday, 7 November 2007

Chapter 6, Lesson 2 - Working with Images.

To display, create & modify images.

  • System.Drawing.Image
  • abstract class.
  • to create, load, modify, save .BMP, .JPG, .TIF files.
  • Bitmap Class - inherits from Image - for still images.
  • MetaFile Class - inherits from Image - for animated images.
  • Bitmap.GetPixel() - Returns a Color obj describing a particular pixel in the image.
  • Bitmap.SetPixel() - ...to a specific colour.
  • display an image in a form #1 - 1) load it - Image.FromFile(), 2) create a PictureBox control, 3) set image obj to background - pictureBox1.BackgroundImage = i;
  • display an image in a form #2 - 1) new Bitmap(); 2) .CreateGraphics(); 3) DrawImage().
  • create a new, blank picture - create instance of Bitmap class that does not require an existing image.
  • Edit new image - Bitmap.SetPixel or Graphics.FromImage().
  • icons -

No comments: