• home
  • forum
  • my
  • kt
  • download
  • Graphics With C#

    Author: 2008-09-12 13:51:27 From:

    INTRODUCTION

    The .Net provides classes for the programmer to be able to work with graphics. This technology is called GDI+ and controls custom drawing on the screen. These classes instruct the graphics device driver to send the appropriate output on the screen. This tutorial is an introduction to the GDI+ technology in order to start drawing simple objects on screen.

    GDI

    When the computer want to print anything on the screen it does so by sending instructions to the video card. You don’t need to know anything special about the operation of the video card. However, each video card has its own capabilities, instruction set and different drivers. For windows programs, you do not need to know all these data. Instead, you call the windows API to do the specific task, and the GDI figures out how to perform the requested task. It also makes devices like a printer to have similar operation to a monitor. You can either print on screen or on a printer. GDI exposes a high-level API to the developers. It is based on an old windows style with C – style functions.

    GDI +

    The GDI+ wraps around the GDI and is between the GDI technology and the developer’s API. GDI+ provides new features and performance improvements to some of the older features of the GDI. The GDI+ part of the .Net environment contains a huge list of classes and methods and you can find them in the SDK documentation.

    The GDI+ is based on the following namespaces:

    ·         System.Drawing: Contains most of the classes, structs and enumerations concerned with the basic functionality of drawing.

    ·         System.Drawing.drawing2D: Provided advanced 2D and vector drawing such as anti-aliasing, geometric transformations and graphic paths.

    ·         System.Drawing.Imaging:  contains classes that assist in the manipulation of images.

    ·         System.Drawing.Printing: Contains classes to assist when targeting a printer as the output device.

    ·         System.Drawing.Design: Contains some pre-defined dialog boxes, property sheets and other user interface elements concerned with extending the design-time user interface.

    ·         System.Drawing.Text: Contains classes to perform more advanced manipulation of fonts.

    In GDI and GDI+ you use a device context object as the device in which you want the output to go. The GDI can then translate the appropriate API functions in the device’s instructions that need to be sent. You can also query this object in order to retrieve information about the devices capabilities. For example, a printer can only print in black and white or in color. If you send an unsupported request to the device, it will either throw an error or perform the most suitable action. The device class is in the .Net System.Drawing.Graphics namespace. Most methods are called on an instance of graphics object. Understanding the use of this object is crucial to understanding graphics in C#, since almost all operations involve a Graphics instance somewhere.

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      Database Related (0)
      Development (4)
      File Manipulation (3)
      Games and Entertainment (10)
      Graphics (12)
      Introduction to C and Cpp (23)
      Miscellaneous (9)
      Networking (5)
      Programming in C and Cpp (10)
      Security (3)

    New

    Hot