SlideShare a Scribd company logo
1 of 20
H O N O R S C O M P U T E R P R O G R A M M I N G I
Module 14
Objective/Essential Standard
 Essential Standard
 8.00 Apply procedures to develop graphics applications
 Indicator
 8.01 Understand coordinate systems. (3%)
 8.02 Apply Procedures to Create Picture Boxes Using Images.
(5%)
Coordinate Systems
 With Visual Studio, any object, whether it is a form or a
label uses the same coordinate system.
 The top left corner, or the origin is 0, 0.
 The bottom right corner is the width and height of the
control (in this case, the label).
0, 0
Width, Height
Coordinate Systems
 The default coordinate system is made up of rows
and columns of pixels.
 The pixels are the smallest points you can locate on the form.
Coordinate Systems
 As you increase the x, you move across to the right.
 As you increase the y, you move down.
(0, 0)
x = 50
Y = 50
(50, 50)
Coordinate Systems
 You can also indicate the width of the object by using its
Width property.
 Likewise you can indicate the height of the object using
its Height property.
0, 0
lblDraw.Width
lblDraw.Height
Coordinate Systems
 To indicate the form’s height
maxHeight = Me.Height
 To indicate the form’s width
maxWidth = Me.Width
 You can use the Height and
Width properties to set
relative positions.
Form’s Width
and Height
Adding Images to Your Project
1. In the Solution Explorer,
double-click My Project
2. The following is displayed.
Adding Images to Your Project
3. Select the Resources tab.
4. Go to the Strings tab
 click the drop-down arrow.
 Select Images
5. Go to the Add Resource tab
 click the drop-down arrow.
6. To add an existing image, select Add Existing.
To create and add an image, select New Image,
then the image type.
PictureBox Control
 The PictureBox control displays an image.
 The image can be one of the following formats.
 Bitmap
 GIF
 JPEG
 Best use
 Enhanced Metafile
 Icon
Adding A PictureBox Control
 Click the PictureBox control in the ToolBox.
 Draw the rectangular picture box on your form.
 Set the Properties.
PictureBox Control
PictureBox Properties Description
(Name) The name of a PictureBox should start with pic
Image Sets the image to display in the PictureBox
SizeMode
Normal (Default)
StretchImage
AutoSize
CenterImage
Zoom
Controls the image sizing and position
places in the top-left corner of the Picture Box
resizes the image to fit the PictureBox
resizes the PictureBox to fit the image
puts the image in the middle of the PictureBox
resizes the image to fit the PictureBox but maintains the
original ratio
PictureBox Event Description
Click Occurs when the user clicks the PictureBox
Adding Images to the PictureBox Control
 Select the PictureBox
 Click in the Image property area
 The Ellipsis displays.
 The Select Resource dialog displays
Adding Images to the PictureBox Control
Adding Images to the PictureBox Control
 Your image will be added to the list.
Using the PictureBox
 You can set the Image property during runtime
Me.PictureBox.Image = My.Resources.ImgName
 Example
Changing How the Image Displays
 Remember the SizeMode property of the PictureBox
will change how the image is displayed.
 To change how the image is displayed at runtime,
you can change the SizeMode property.
Me.PictureBox.SizeMode = PictureBoxSizeMode.SizeModeValue
 Where the SizeModeValue is one of the choices given: Normal
(Default), StretchImage , AutoSize, CenterImage, Zoom
Animation and Timers
 What if a programmer wanted to load multiple
images to simulate animation?
 This requires VB to lay one image on top of another
to create the illusion of animation.
 This may be done using a new object from the
components area of your toolbox called a timer.
 A timer generates recurring events. Code inside the
timer event will recur until the timer is stopped.
Animation and Timers
 Timers allow programmers to execute code at
specific intervals. Timers may be found in the
toolbox:
 Please note that, once brought over to the form, timers do not actually appear on the form. They can be seen below
the form, in your Component Tray.
Animation and Timers
 Timers only have a few properties.
 The property, Interval, allows the programmer to
specify how many milliseconds lapse when executing
the block of code.

More Related Content

What's hot

Wd133 unit 7 module 3 stylizing with multiple filters
Wd133 unit 7 module 3 stylizing with multiple filtersWd133 unit 7 module 3 stylizing with multiple filters
Wd133 unit 7 module 3 stylizing with multiple filterskateridrex
 
Volumize tutorial final
Volumize tutorial finalVolumize tutorial final
Volumize tutorial finalDouglas Moore
 
Zoom animation feature in ppt
Zoom animation feature in pptZoom animation feature in ppt
Zoom animation feature in pptSaMiyahWright
 
Adding title graphics
Adding title graphicsAdding title graphics
Adding title graphicsasmedia974
 
User guide -gif
User guide -gifUser guide -gif
User guide -gifCho Thwin
 
Geogebra for physics
Geogebra for physicsGeogebra for physics
Geogebra for physicsLenore Horner
 
Dig imag unit 2 module 3 modifying selections
Dig imag unit 2 module 3 modifying selectionsDig imag unit 2 module 3 modifying selections
Dig imag unit 2 module 3 modifying selectionskateridrex
 
Graphics worksheet 3
Graphics worksheet 3Graphics worksheet 3
Graphics worksheet 3ORKO95
 
PhotoshopBeyondBasics
PhotoshopBeyondBasicsPhotoshopBeyondBasics
PhotoshopBeyondBasicstutorialsruby
 
2.1 graphics window
2.1   graphics window2.1   graphics window
2.1 graphics windowallenbailey
 
Fundamentals Image and Graphics
Fundamentals Image and GraphicsFundamentals Image and Graphics
Fundamentals Image and GraphicsShrawan Adhikari
 
Wd133 unit 2 module 3 modifying selections
Wd133 unit 2 module 3 modifying selectionsWd133 unit 2 module 3 modifying selections
Wd133 unit 2 module 3 modifying selectionskateridrex
 
How to Create Shadow in photoshop cs6 - Photoshop Tutorial
How to Create Shadow in photoshop  cs6 - Photoshop Tutorial How to Create Shadow in photoshop  cs6 - Photoshop Tutorial
How to Create Shadow in photoshop cs6 - Photoshop Tutorial CPZ Media
 

What's hot (18)

Wd133 unit 7 module 3 stylizing with multiple filters
Wd133 unit 7 module 3 stylizing with multiple filtersWd133 unit 7 module 3 stylizing with multiple filters
Wd133 unit 7 module 3 stylizing with multiple filters
 
Adobe photoshop
Adobe photoshopAdobe photoshop
Adobe photoshop
 
Volumize tutorial final
Volumize tutorial finalVolumize tutorial final
Volumize tutorial final
 
Image j advanced
Image j   advancedImage j   advanced
Image j advanced
 
Editable poly furniture models
Editable poly furniture modelsEditable poly furniture models
Editable poly furniture models
 
Zoom animation feature in ppt
Zoom animation feature in pptZoom animation feature in ppt
Zoom animation feature in ppt
 
Adobe photoshop
Adobe photoshopAdobe photoshop
Adobe photoshop
 
Adding title graphics
Adding title graphicsAdding title graphics
Adding title graphics
 
User guide -gif
User guide -gifUser guide -gif
User guide -gif
 
Geogebra for physics
Geogebra for physicsGeogebra for physics
Geogebra for physics
 
Dig imag unit 2 module 3 modifying selections
Dig imag unit 2 module 3 modifying selectionsDig imag unit 2 module 3 modifying selections
Dig imag unit 2 module 3 modifying selections
 
Graphics worksheet 3
Graphics worksheet 3Graphics worksheet 3
Graphics worksheet 3
 
(Sept.14)
(Sept.14)(Sept.14)
(Sept.14)
 
PhotoshopBeyondBasics
PhotoshopBeyondBasicsPhotoshopBeyondBasics
PhotoshopBeyondBasics
 
2.1 graphics window
2.1   graphics window2.1   graphics window
2.1 graphics window
 
Fundamentals Image and Graphics
Fundamentals Image and GraphicsFundamentals Image and Graphics
Fundamentals Image and Graphics
 
Wd133 unit 2 module 3 modifying selections
Wd133 unit 2 module 3 modifying selectionsWd133 unit 2 module 3 modifying selections
Wd133 unit 2 module 3 modifying selections
 
How to Create Shadow in photoshop cs6 - Photoshop Tutorial
How to Create Shadow in photoshop  cs6 - Photoshop Tutorial How to Create Shadow in photoshop  cs6 - Photoshop Tutorial
How to Create Shadow in photoshop cs6 - Photoshop Tutorial
 

Similar to M14 overview

Image contro, and format functions in vb
Image contro, and format functions in vbImage contro, and format functions in vb
Image contro, and format functions in vbAmandeep Kaur
 
Libre Office Impress Lesson 3: Adding and Formatting pictures
Libre Office Impress Lesson 3: Adding and Formatting picturesLibre Office Impress Lesson 3: Adding and Formatting pictures
Libre Office Impress Lesson 3: Adding and Formatting picturesSmart Chicago Collaborative
 
Picture box control
Picture box controlPicture box control
Picture box controlchauhankapil
 
Adobe photoshop cs6
Adobe photoshop cs6Adobe photoshop cs6
Adobe photoshop cs6Ila Azmil
 
Adobe photoshop cs6
Adobe photoshop cs6Adobe photoshop cs6
Adobe photoshop cs6ilaazmil2
 
Adobe photoshop cs6 tutorial
Adobe photoshop cs6 tutorialAdobe photoshop cs6 tutorial
Adobe photoshop cs6 tutorialAgung Yuwono
 
Photoshop pdf
Photoshop pdfPhotoshop pdf
Photoshop pdfKim B
 
ETECH_WEEK7-Image-Manipulation-Techniques-1.pdf
ETECH_WEEK7-Image-Manipulation-Techniques-1.pdfETECH_WEEK7-Image-Manipulation-Techniques-1.pdf
ETECH_WEEK7-Image-Manipulation-Techniques-1.pdfbongsantiago96
 
Adobe Photoshop CS6 tutorial 2013
Adobe Photoshop CS6 tutorial 2013Adobe Photoshop CS6 tutorial 2013
Adobe Photoshop CS6 tutorial 2013Jessie Doan
 
Ecognition object base image classifications bangladesh
Ecognition object base image classifications bangladeshEcognition object base image classifications bangladesh
Ecognition object base image classifications bangladeshCresencio Turpo
 
1 DIGITAL DOCUMENTATION.pdf
1 DIGITAL DOCUMENTATION.pdf1 DIGITAL DOCUMENTATION.pdf
1 DIGITAL DOCUMENTATION.pdfJNVKGLCS
 
Photoshop_CS_Tutorial
Photoshop_CS_TutorialPhotoshop_CS_Tutorial
Photoshop_CS_Tutorialtutorialsruby
 
Photoshop_CS_Tutorial
Photoshop_CS_TutorialPhotoshop_CS_Tutorial
Photoshop_CS_Tutorialtutorialsruby
 

Similar to M14 overview (20)

Image contro, and format functions in vb
Image contro, and format functions in vbImage contro, and format functions in vb
Image contro, and format functions in vb
 
Libre Office Impress Lesson 3: Adding and Formatting pictures
Libre Office Impress Lesson 3: Adding and Formatting picturesLibre Office Impress Lesson 3: Adding and Formatting pictures
Libre Office Impress Lesson 3: Adding and Formatting pictures
 
Picture box control
Picture box controlPicture box control
Picture box control
 
Adobe photoshop cs6
Adobe photoshop cs6Adobe photoshop cs6
Adobe photoshop cs6
 
Adobe photoshop cs6
Adobe photoshop cs6Adobe photoshop cs6
Adobe photoshop cs6
 
Adobe photoshop cs6 tutorial
Adobe photoshop cs6 tutorialAdobe photoshop cs6 tutorial
Adobe photoshop cs6 tutorial
 
Photoshop pdf
Photoshop pdfPhotoshop pdf
Photoshop pdf
 
ETECH_WEEK7-Image-Manipulation-Techniques-1.pdf
ETECH_WEEK7-Image-Manipulation-Techniques-1.pdfETECH_WEEK7-Image-Manipulation-Techniques-1.pdf
ETECH_WEEK7-Image-Manipulation-Techniques-1.pdf
 
Adobe Photoshop CS6 tutorial 2013
Adobe Photoshop CS6 tutorial 2013Adobe Photoshop CS6 tutorial 2013
Adobe Photoshop CS6 tutorial 2013
 
Ecognition object base image classifications bangladesh
Ecognition object base image classifications bangladeshEcognition object base image classifications bangladesh
Ecognition object base image classifications bangladesh
 
Basic tutorials
Basic tutorialsBasic tutorials
Basic tutorials
 
Basic tutorials
Basic tutorialsBasic tutorials
Basic tutorials
 
Photoshop
PhotoshopPhotoshop
Photoshop
 
Photoshop basics
Photoshop basicsPhotoshop basics
Photoshop basics
 
1 DIGITAL DOCUMENTATION.pdf
1 DIGITAL DOCUMENTATION.pdf1 DIGITAL DOCUMENTATION.pdf
1 DIGITAL DOCUMENTATION.pdf
 
Topic 1_PPT.pptx
Topic 1_PPT.pptxTopic 1_PPT.pptx
Topic 1_PPT.pptx
 
Photoshop_CS_Tutorial
Photoshop_CS_TutorialPhotoshop_CS_Tutorial
Photoshop_CS_Tutorial
 
Photoshop_CS_Tutorial
Photoshop_CS_TutorialPhotoshop_CS_Tutorial
Photoshop_CS_Tutorial
 
Photoshop cs tutorial
Photoshop cs tutorialPhotoshop cs tutorial
Photoshop cs tutorial
 
Photoshop
PhotoshopPhotoshop
Photoshop
 

More from obrienduke

VB Multiple Forms
VB Multiple FormsVB Multiple Forms
VB Multiple Formsobrienduke
 
VB Lines and Shapes
VB Lines and ShapesVB Lines and Shapes
VB Lines and Shapesobrienduke
 
Unit 4 bugs and debugging
Unit 4 bugs and debuggingUnit 4 bugs and debugging
Unit 4 bugs and debuggingobrienduke
 
Module 3 GUI Design
Module 3 GUI DesignModule 3 GUI Design
Module 3 GUI Designobrienduke
 
Arrays in java
Arrays in javaArrays in java
Arrays in javaobrienduke
 

More from obrienduke (9)

VB Multiple Forms
VB Multiple FormsVB Multiple Forms
VB Multiple Forms
 
VB Lines and Shapes
VB Lines and ShapesVB Lines and Shapes
VB Lines and Shapes
 
Graphics
GraphicsGraphics
Graphics
 
Mod 12
Mod 12Mod 12
Mod 12
 
Module 7
Module 7Module 7
Module 7
 
Unit 4 bugs and debugging
Unit 4 bugs and debuggingUnit 4 bugs and debugging
Unit 4 bugs and debugging
 
Module 3 GUI Design
Module 3 GUI DesignModule 3 GUI Design
Module 3 GUI Design
 
Arrays in java
Arrays in javaArrays in java
Arrays in java
 
Nested loops
Nested loopsNested loops
Nested loops
 

Recently uploaded

Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 

Recently uploaded (20)

Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 

M14 overview

  • 1. H O N O R S C O M P U T E R P R O G R A M M I N G I Module 14
  • 2. Objective/Essential Standard  Essential Standard  8.00 Apply procedures to develop graphics applications  Indicator  8.01 Understand coordinate systems. (3%)  8.02 Apply Procedures to Create Picture Boxes Using Images. (5%)
  • 3. Coordinate Systems  With Visual Studio, any object, whether it is a form or a label uses the same coordinate system.  The top left corner, or the origin is 0, 0.  The bottom right corner is the width and height of the control (in this case, the label). 0, 0 Width, Height
  • 4. Coordinate Systems  The default coordinate system is made up of rows and columns of pixels.  The pixels are the smallest points you can locate on the form.
  • 5. Coordinate Systems  As you increase the x, you move across to the right.  As you increase the y, you move down. (0, 0) x = 50 Y = 50 (50, 50)
  • 6. Coordinate Systems  You can also indicate the width of the object by using its Width property.  Likewise you can indicate the height of the object using its Height property. 0, 0 lblDraw.Width lblDraw.Height
  • 7. Coordinate Systems  To indicate the form’s height maxHeight = Me.Height  To indicate the form’s width maxWidth = Me.Width  You can use the Height and Width properties to set relative positions. Form’s Width and Height
  • 8. Adding Images to Your Project 1. In the Solution Explorer, double-click My Project 2. The following is displayed.
  • 9. Adding Images to Your Project 3. Select the Resources tab. 4. Go to the Strings tab  click the drop-down arrow.  Select Images 5. Go to the Add Resource tab  click the drop-down arrow. 6. To add an existing image, select Add Existing. To create and add an image, select New Image, then the image type.
  • 10. PictureBox Control  The PictureBox control displays an image.  The image can be one of the following formats.  Bitmap  GIF  JPEG  Best use  Enhanced Metafile  Icon
  • 11. Adding A PictureBox Control  Click the PictureBox control in the ToolBox.  Draw the rectangular picture box on your form.  Set the Properties.
  • 12. PictureBox Control PictureBox Properties Description (Name) The name of a PictureBox should start with pic Image Sets the image to display in the PictureBox SizeMode Normal (Default) StretchImage AutoSize CenterImage Zoom Controls the image sizing and position places in the top-left corner of the Picture Box resizes the image to fit the PictureBox resizes the PictureBox to fit the image puts the image in the middle of the PictureBox resizes the image to fit the PictureBox but maintains the original ratio PictureBox Event Description Click Occurs when the user clicks the PictureBox
  • 13. Adding Images to the PictureBox Control  Select the PictureBox  Click in the Image property area  The Ellipsis displays.  The Select Resource dialog displays
  • 14. Adding Images to the PictureBox Control
  • 15. Adding Images to the PictureBox Control  Your image will be added to the list.
  • 16. Using the PictureBox  You can set the Image property during runtime Me.PictureBox.Image = My.Resources.ImgName  Example
  • 17. Changing How the Image Displays  Remember the SizeMode property of the PictureBox will change how the image is displayed.  To change how the image is displayed at runtime, you can change the SizeMode property. Me.PictureBox.SizeMode = PictureBoxSizeMode.SizeModeValue  Where the SizeModeValue is one of the choices given: Normal (Default), StretchImage , AutoSize, CenterImage, Zoom
  • 18. Animation and Timers  What if a programmer wanted to load multiple images to simulate animation?  This requires VB to lay one image on top of another to create the illusion of animation.  This may be done using a new object from the components area of your toolbox called a timer.  A timer generates recurring events. Code inside the timer event will recur until the timer is stopped.
  • 19. Animation and Timers  Timers allow programmers to execute code at specific intervals. Timers may be found in the toolbox:  Please note that, once brought over to the form, timers do not actually appear on the form. They can be seen below the form, in your Component Tray.
  • 20. Animation and Timers  Timers only have a few properties.  The property, Interval, allows the programmer to specify how many milliseconds lapse when executing the block of code.