GDI+ Custom Controls with Visual C# 2005 Working with Images
Ever since Graphical User Interfaces (GUIs) were invented, developers have been keen to use images to make their programs easier to use, and more attractive and intuitive to their users. Images brighten up an otherwise boring and clinical computer screen, and make the general computing experience more enjoyable. Visual support facilitates the information absorption and presentation of up-to-date information. Any user can more easily understand information just by looking at a picture. Images are the most intuitive memories because the human mind in most cases has a visual memory. This means that when you recall a memory it is frequently a visual one. Think briefly of a tree. What comes to your mind first? Is it the roughness of bark, the taste of fruit or nuts, the smell of tree, the rustle of leaves-or is it a picture of a tree?
Have you ever wondered what it was like before the GUI? There were just text-mode applications. The GUI tried and succeeded in emulating different features of reality. Today, computers can easily reproduce the image and the sound of a tree and in the years to come they will become increasingly better at it. As regards to the custom controls, these can be user-friendly, if you do the job the right way. It is up to you to develop a custom control that has a good-looking interface. The rendering can be done using drawing lines and curves, using brushes and text; but sometimes it can be improved using images. For example, the Save button in a common application has a floppy disk picture associated, loaded from an image file. In this chapter, we will discuss how .NET deals with images, and how it can be used to improve your software. We’ll visit the Image, Bitmap, and Graphics objects and create a powerful component that you can include in your own programs. You’ll learn how to create a picture from scratch without any user intervention, and you’ll see some of the cool capabilities of GDI+ in action. Most of the examples take the form of short code snippets, although we will look at creating a small but powerful component that will fast-track you towards some of the more detailed image effects that .NET has to offer.
…
Using the Image Class
The Image class is usually your first port of call when using images in .NET programming. It enables you to store a picture in memory so that it can be manipulated, and it exposes many pieces of information about that picture, including its size and how many colors are used. Image is the base class from which another class, Bitmap, is derived. We’ll be looking at Bitmap in a while, but we should look at Image’s capabilities first.
…
Website: www.c-sharpcorner.com | Filesize: 348kb
No of Page(s): 27
Click here to download GDI+ Custom Controls with Visual C# 2005 Working with Images.
Related Tutorial
Tags: .NET, custom control, GDI+, graphics programming, GUI
Comments
Leave a Reply