Računarska grafika GDI+ (Graphics Device Interface Plus)

Slides:



Advertisements
Similar presentations
2.01 Investigate graphic image design.
Advertisements

1 SESSION 6 Using tables and graphs in project work.
Reading and Writing Text Files Svetlin Nakov Telerik Corporation
Information Representation
1 Drawing C Sc 335 Object-Oriented Programming and Design Rick Mercer.
.NET Framework Overview. Whats in the 1.1 Framework physical assemblies physical assemblies Hundreds of namespaces Hundreds of namespaces.
Bitmap and Vector Graphics. Bitmap Graphics Photos Scanned Images Animations Most pictures you find on the Internet Photos are JPG files – lots of colours.
Graphics CS 121 Concepts of Computing II. What is a graphic? n A rectangular image. n Stored in a file of its own, or … … embedded in another data file.
OOP Project Develop an Application which incorporates the following OO Mechanisms and Principals: – Classes Visibility Constructor(s) Class Variable (if.
Graphics and Multimedia. Outline Introduction Graphics Contexts and Graphics Objects Color Control.
SWE 423: Multimedia Systems Chapter 4: Graphics and Images.
GDI+ getting started. GDI+  Class-based API for C/C++  Windows Graphics Device Interface (GDI)  Device-independent applications  Services 1)2D vector.
PictureBox, Timer, Resources. Resources An easy and effective way to add pictures (photos, graphics) to your programs Using Resources guarantees that.
Java Review Structure of a graphics program. Computer Graphics and User Interfaces Java is Object-Oriented A program uses objects to model the solution.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
How do bitmapped graphics differ? Bitmaps are the most common type of picture format. Vector images are inherently different from bitmap images.
Računarska grafika GDI+ (Graphics Device Interface Plus)
Graphics and Multimedia. Introduction The language contains many sophisticated drawing capabilities as part of namespace System.Drawing and the other.
Manipulating Images Image A visual representation of something that is seen in real life. It can be two-dimensional or three-dimensional A visual representation.
1 Chapter 26 D&D – Graphics Outline 26.1 Introduction 26.3 Graphics Contexts and Graphics Objects 26.4 Color Control 26.5 Font Control 26.6 Drawing Lines,
Fonts Typeface Typography. Leading Spacing between lines.
Lecture Set 13 Drawing Mouse and Keyboard Events Part A - Drawing.
Graphics: Creating Images Chapter 8, Exploring the Digital Domain.
Java Programming, 2E Introductory Concepts and Techniques Chapter 2 Creating a Java Application and Applet.
Computer Programming and Basic Software Engineering 9 Building Graphical User Interface A Brief Introduction to GDI+ S.R.G. Fraser, Pro Visual C++/CLI.
Java Programming, 3e Concepts and Techniques Chapter 2 - Part 2 Creating a Java Application and Applet.
Računarska grafika GDI+ (Graphics Device Interface Plus)
1 Pertemuan 12 Linking and Embedding, Saving and Exporting Matakuliah: U0344 / DESKTOP 1 Tahun: 2006.
Simple Graphics. Graphics Used in PowerPoint, Web pages and others Basic Knowledge drawing change of colour, shape and others acquiring, video camera,
Tutorial 6 Working with Bitmaps and Gradients, and Publishing Flash Files.
Working with Symbols and Interactivity
Why Icon? An icon is a small picture that represents a file. Icons help you execute commands, open programs or documents quickly. It is also useful to.
XP Tutorial 1 Introduction to Macromedia Flash MX 2004.
Copyright © 2009 Curt Hill The Picture Object Getting and displaying.
Multimedia Elements II Graphics, Digital Video. UIT - Multimedia Production2 Multimedia Elements Multimedia elements include: Text Graphics Animation.
Lecture 15: Intro to Graphics Yoni Fridman 7/25/01 7/25/01.
Information Processes and Technology Multimedia: Graphics.
CS- 375 Graphics and Human Computer Interaction Lecture 1: 12/4/1435 Fundamental Techniques in Graphics Lecturer: Kawther Abas.
Multimedia def. Many forms. Multimedia Text Hyperlinks Images Audio Animation Video Text Hyperlinks Images Audio Animation Video.
By Courtney Field Creative digital graphics. Types of graphics and examples There are a number of different types of graphics file formats. Each type.
Chapter 2 File Format Objectives (1 of 2) Identify the difference between vector based graphics and bitmap-based graphics Clarify 3 types of vector programs.
Graphics & Images What File Format Do I Use?. Graphics & Images …..are visual images presented on some form of media (drawings, print, web, digital video)
Presentation Outline Introduction Painting and Repainting GDI.
1 Graphic Device Interface (GDI). 2 Class Form A Form is a representation of any window displayed in your application. The Form class can be used to create.
BallWorld.java A structured walkthrough. Key Features: 2 classes are created Execution is done through the procedure called “main” which are decleared.
The Abstract Window Toolkit (AWT) supports Graphical User Interface (GUI) programming. AWT features include: a rich set of user interface components; a.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Chapter 8B Graphics and Multimedia.
Digital imaging. Two types of graphic Bitmap Vector.
COMPUTER GRAPHICS. Can refer to the number of pixels in a bitmapped image Can refer to the number of pixels in a bitmapped image The amount of space it.
Chapter 8B Graphics and Multimedia. 8B-2 Graphic File Formats Bitmapped images –Most common image type –Also called raster images –Image is drawn using.
CSCI-100 Introduction to Computing Hardware Part II.
Creating a Java Application and Applet
Resources & Bitmaps Adding clip art to your application.
RASTERIZING SHAPES IN PHOTOSHOP RASTERIZE: A process in Photoshop of converting a vector image into a bitmap (or raster) image VECTOR: A vector image is.
Lesson 9: Web Graphics. Objectives Distinguish between vector and raster graphic types Identify and choose appropriate image file formats, including browser-compatibility.
GDI +. Graphics class's methods System.Drawing Graphics Objects.
1 Sections 5.1 – 5.2 Digital Image Processing Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Introducing, the JFrame Gives us a work area beside System.out.println.
Introduction To GDI GDI Definition : It is a interface present in windows which provide function and related structures that an application can use to.
8th Lecture – Intro to Bitmap or Raster Images
Introduction to Graphics
CSI-447: Multimedia Systems
Graphics.
Programming Windows with C# Chapter23 Metafiles
Graphics and Multimedia
6th Lecture – Rectangles and Regions, and intro to Bitmap Images
Bitmaps in Windows API.
Introducing Adobe Illustrator
Program for interactive plotting of tri-linear data.
Images and Bitmaps (in C#)
Presentation transcript:

Računarska grafika GDI+ (Graphics Device Interface Plus)

Metafiles in GDI+ GDI+ provides the Metafile class so that you can record and display metafiles. A metafile, also called a vector image, is an image that is stored as a sequence of drawing commands and settings. The commands and settings recorded in a Metafileobject can be stored in memory or saved to a file or stream. GDI+ can display metafiles that have been stored in the following formats: ▫Windows Metafile (WMF) ▫Enhanced Metafile (EMF) ▫EMF+  EMF+ Only(GDI+ only)  EMF+ Dual(GDI & GDI+ - dual records) *GDI+ can record metafiles in the EMF and EMF+ formats, but not in the WMF format.

Metafiles in GDI+ Metafiles contain information about how an image was created - including lists of graphics operations - rather than storing the image in pixel format. Graphics operations in a metafile are stored as records, which can be controlled (recorded and played back) individually. The Metafile class provides about 40 overloaded forms of its constructor. Loading and viewing a metafile is similar to viewing a bitmap. An application can load a metafile from a stream, string, or IntPtr instance with different formats and locations. The simplest way to load and view a metafile is to pass the file name in the Metafile constructor and call DrawImage.

Metafile Class The Metafile class is derived from the Image class has no methods and properties beside those inherited from the Image class. the Metafile class provides a long list of overloaded constructor. It also provides three methods: ▫GetHenhMetafile  returns a window handle to a metafile ▫GetMetafileHeader  which has five overloaded forms, returns a metafile header in the form of a MetafileHeader object. ▫PlayRecord.  plays (reads and displays) an extended metafile.

Metafile Class Metafile( string filename ) ▫filename  A String that represents the file name from which to create the new Metafile. Metafile( string fileName, IntPtr referenceHdc ) ▫fileName  A String that represents the file name of the newMetafile. ▫referenceHdc  A Windows handle to a device context.

Example Graphics g = e.Graphics; g.Clear(this.BackColor); IntPtr hdc = g.GetHdc(); Metafile metafajlic = new and Settings\Ognjen\Desktop\RG\test.emf", hdc); Graphics g1 = Graphics.FromImage(metafajlic); g1.SmoothingMode = SmoothingMode.HighQuality; Rectangle kvadratic = new Rectangle(0, 0, 200, 200); g1.FillRectangle(Brushes.Green, kvadratic); kvadratic.Y += 110; LinearGradientBrush cetkica = new LinearGradientBrush(kvadratic, Color.Red, Color.Blue, 45.0f); g1.FillEllipse(cetkica, kvadratic);

Example kvadratic.Y += 110; g1.DrawString("Računarska grafika, I.Sarajevo\nMetaFile test", new Font("Verdana", 20), cetkica, 200, 200, StringFormat.GenericTypographic); g.ReleaseHdc(hdc); metafajlic.Dispose(); metafajlic = new and Settings\Ognjen\Desktop\RG\test.emf"); g.DrawImage(metafajlic, 0, 0); metafajlic.Dispose(); g1.Dispose();

Example Bitmap slicica = new Bitmap(616, 310); g1 = Graphics.FromImage(slicica); g1.SmoothingMode = SmoothingMode.HighQuality; kvadratic = new Rectangle(0, 0, 200, 200); g1.FillRectangle(Brushes.Green, kvadratic); kvadratic.Y += 110; g1.FillEllipse(cetkica, kvadratic); kvadratic.Y += 110; g1.DrawString("Računarska grafika, I.Sarajevo\nMetaFile test", new Font("Verdana", 20), cetkica, 200, 200, StringFormat.GenericTypographic);

Example and Settings\Ognjen\Desktop\RG\testic.bmp", ImageFormat.Bmp); and Settings\Ognjen\Desktop\RG\testic.jpg", ImageFormat.Jpeg); and Settings\Ognjen\Desktop\RG\testic.gif", ImageFormat.Gif); and Settings\Ognjen\Desktop\RG\testic.png", ImageFormat.Png); and Settings\Ognjen\Desktop\RG\testic.emf", ImageFormat.Emf); g.DrawImage(slicica, 0, 350); g1.Dispose(); g.Dispose();

Example