Category Archive for: Graphics with GDI+

Printing

However, at some point you will probably also want to be able to produce a hard copy of the data, You are going to extend the CapsEditor sample so that it is able to print preview and print the document that is being edited. Unfortunately there is not enough space to go into too much detail about printing…

Read More →

Editing a Text Document: The CapsEditor Sample

The CapsEditor example is designed to demonstrate how the principles of drawing that you have learned so far have to be applied in a more realistic context, The CapsEditor example does not require any new material, apart from responding to user input via the mouse, but it shows how to manage the drawing of text so that the…

Read More →

Issues When Manipulating Images

Although displaying images is very simple, it still pays to have some understanding of what is going on behind the scenes. The-most important point to understand about images is that they are always rectangular, That is not just a convenience, it is because of the underlying technology, AIl modern graphics cards have hardware built in that can efficiently…

Read More →

Displaying Images

One of the most common things you might want to do with GDI+ is display an image that already exists in a file This  is actually a lot simpler than drawing your own user interface because the image is already pre-drawn, Effectively, all you have to do is load the file and instruct GDI+ to display it,…

Read More →

Drawing Shapes and Lines

You have almost finished the first part of the chapter, and you have seen all the basic classes and objects required to draw specified shapes and so on to the screen, This section starts by reviewing some of the drawing methods the Graphics class makes available and presents a short example that illustrates the use of several brushes…

Read More →

Colors

This section discusses the ways that you can specify what color you want something to be drawn in. Colors in GDI+ are represented by instances of the System, Drawing Color struct, Generally, once you have instantiated this struct, you won’t do much with the corresponding Color instance – you just pass it to whatever other method you…

Read More →

World, Page, and Device Coordinates

The distinction between measuring position relative to the top-left corner of the document and measuring it relative to the top-left comer of the screen (desktop) is so important that GDI+ has special names for these coordinate systems: World coordinates specify the position of a point measured in pixels from the top-left corner of the document. Page coordinates specify…

Read More →

Drawing Scrollable Windows

The earlier Draw Shapes example worked very well because everything you needed to draw fit into initial window size, This section covers what you need to do if that is not the case. this example, you expand the Draw Shapes sample to demonstrate scrolling, To make things a bit realistic, you start by creating an example, Big…

Read More →

A Note About Debugging

You are just about ready to do some more advanced types of drawing now. First, however, we just want to say a few things about debugging, If you have tried setting break points, then you have noticed that debugging drawing routines is not quite as simple as debugging other parts of your program because entering and leaving the…

Read More →

Measuring Coordinates and Areas

In the previous example, you encountered the base struct, Rectangle, which is used to represent the coordinates of a rectangle, GDI+ actually uses several similar structures to represent coordinates or areas. The following table lists the structs that are defined in the System. Drawing namespace. Note that many of these objects have a number of other…

Read More →

Back to Top