Graphics Drawing Demo 2005 - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Graphics Drawing Demo 2005

Description:

Instead of requiring the user to type in a filename, we can use the ... Avast, ye mateys! There be rough seas* ahead! Lubbers should steer to the shore. ... – PowerPoint PPT presentation

Number of Views:203
Avg rating:3.0/5.0
Slides: 14
Provided by: Rap46
Category:
Tags: avast | demo | drawing | graphics

less

Transcript and Presenter's Notes

Title: Graphics Drawing Demo 2005


1
Graphics - Drawing Demo 2005
image goofy.jpg located inside Folder, Debug
picBox
txtFileName
btnInvert
btnGrayscale
btnLoad
2
Method to Read Image File
3
class Form1
declare img as a Bitmap
button event passes image by reference
. . .
4
Method Invert( )
inverts level of each color value of each pixel
5
Method Grayscale( )
sets all three color values to the average level
6
OpenFileDialog
Instead of requiring the user to type in a
filename, we can use the OpenFileDialog class to
bring up a file directory. This directory will
show the folder and files at the current level.
We can limit the files to those with a particular
set of extensions as shown. When the appropriate
file is selected, the picBox.Image can be
assigned a new Bitmap using the selected image
file.
7
Avast, ye mateys! There be rough seas
ahead! Lubbers should steer to the shore.
Proceed at yer own risk!
The following section is optional, for those who
are interested in learning how to make
pixel-level image operations faster (i.e.
practical).
such as C, C, C with pointers !!!!
8
Image Pixel Format
24 bit per pixel is 1 byte per color
scan line
red byte
blue byte
green byte
scan line must be a multiple of 4 bytes, so each
line is padded with between 0 and 3 bytes
9
Locking and Unlocking the Bitmap
pointer to the beginning of the first scan line
of the image
10
Pixel Operations
11
Fast Grayscale Method
12
Fast Invert Method
13
Form1 Button Events to Access ImgPro Methods
Write a Comment
User Comments (0)
About PowerShow.com