This site was last updated:Monday 13 October 2008, 11:30 GMT

Educational Community

GRAPHICS WITH C#
(0 votes, average: 0 out of 5)
Written by Christopher   
Sunday, 15 June 2008 15:32

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.

Trackback(0)
Comments (1)add comment

saurav said:

hi am interested about graphics programming.
 
report abuse
vote down
vote up
November 09, 2008
Votes: +0

Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
smile
wink
laugh
grin
angry
sad
shocked
cool
tongue
kiss
cry
smaller | bigger

busy
 

User Menu

None
Become a sponsor Become a sponsor Become a sponsor Become a sponsor Become a sponsor KNOGE.com offers free video and text tutorials on various softwares also free resources to improve your economy and start making money online. THIS IS ONLY A TEST AD TO DISPLAY HOW IT MIGHT LOOK Become a sponsor Become a sponsor Become a sponsor Become a sponsor Become a sponsor Become a sponsor Become a sponsor Become a sponsor Become a sponsor Become a sponsor Become a sponsor Become a sponsor Become a sponsor Become a sponsor

Adobe InDesign CS3 - Working with objects

Objects in Adobe InDesign CS3 are the basic building block of any design that you do. In this video tutorial you will learn how to create those blocks easily in...

InDesign Videos | Christopher

Read More

Adobe InDesign CS3 - Working with Panels & More

In this Adobe InDesign CS3 video tutorial you will learn how to set keys and work with panels, you will also learn how to create customized keyboard shortcuts for optimized...

InDesign Videos | Christopher

Read More

Adobe Photoshop CS3 - Create customized rust on cars

This Adobe Photoshop CS3 video tutorial will teach you how to create your own customized rust on cars for a more grungy and perhaps dusty effect. This technique does also...

Photoshop Videos | Christopher

Read More
100%
-
+
3
Show options