Gdi

232 views

Published on

  • Be the first to comment

  • Be the first to like this

Gdi

  1. 1. GDI
  2. 2. • GDI provides a layer of abstraction, hiding the differences between the different video cards. You simply call the Windows API function to do the specific task, and internally the GDI figures out how to get your particular video card to do whatever it is you want. • the device-context object (DC) is a very powerful object and you won’t be surprised to learn that under GDI all drawing had to be done through a device context.
  3. 3. • GDI+ to a large extent sits as a layer between GDI and your application, providing a more intuitive, inheritance-based object model. • Although GDI+ is basically a wrapper around GDI, Microsoft has been able through GDI+ to provide new features and claims to have made some performance improvements.
  4. 4. • System.Drawing namespace that encapsulates .NET’s basic graphics functionality, which is known as GDI+. • The name GDI+ comes from the original Windows graphics library, which was called the Graphical Device Interface. • It is a library of simple 2D graphics designed to draw lines and shapes, draw text, and display bitmaps. There is no 3D functionality in any of GDI+. • If you need 3D graphics, you are going to have to consider using Direct3D.
  5. 5. GDI+ namespaces • System.Drawing :-Contains most of the classes, structs, enums, and delegates concerned with the basic functionality of drawing • System.Drawing.Drawing2D:- Provides most of the support for advanced 2D and vector drawing, including anti-aliasing, geometric transformations, and graphics paths • System.Drawing.Imaging:- Contains various classes that assist in the manipulation of images (bitmaps, GIF files, and so on)
  6. 6. classes • the .NET base class System.Drawing.Graphics . Most drawing is done by calling methods on an instance of Graphics . • In fact, since the Graphics class is the class that is responsible for handling most drawing operations, • Form1, derived from System.Windows.Form, which represents the application’s main window. • System.Drawing.Pen : A Pen is one of a number of supporting objects to help with drawing
  7. 7. • PaintEventArgs is a class that is derived from the EventArgs class normally used to pass in informa-tion about events. • Region is a class that represents an area of the screen that has some complex shape. the process of initializing a Region instance is itself quite complex. • the Control class, from which both Form and all the various Windows Forms controls derive, that maintains the information needed to carry out the conversion.
  8. 8. blending and alpha blending • Alpha blending is the process of creating a Pen, Brush, or Image that has attributes that determine its transparency. • Blending is the process of drawing a line or filling a shape with a color that starts out at one end of the spectrum (range) and ends at the other. • An example of alpha blending would be creating an image on the screen. • An example of blending would be drawing an ellipse that is filled starting with blue and ending with red
  9. 9. The top one is the gamma correction for the top image and the bottom one is the alpha blend for the line.
  10. 10. GDI+ • Alpha blending allows two objects to be visually blended(merge) together. This is primarily used for 3D atmospheric and environmental effects. • It allows such things as "fogging", where an image is rendered behind another translucent (clear) image, which creates the effect of looking though fog or looking down through a pool and seeing the bottom. It also allows Depth Cueing, which is the lowering of the intensity of lighting to make an object appear farther away.

×