17.11. Loading, Displaying and Scaling Images
Visual Basic’s multimedia capabilities include graphics, images, animations and video. Previous sections demonstrated vector-graphics capabilities; this section presents image manipulation. The application in Fig. 17.23 loads an Image (System.Drawing namespace), then allows the user to scale the Image to a specified width and height.
Figure 17.23. Image resizing.
1 ' Fig. 17.23: FrmDisplayLogo.vb 2 ' Displaying and resizing an image 3 Public Class FrmDisplayLogo 4 Private imageValue As Image 5 Private graphicsObject As Graphics 6 7 ' load image and obtain Graphics object 8 Private Sub FrmDisplayLogo_Load(ByVal sender As Object, _ 9 ByVal e As System.EventArgs) Handles Me.Load 10 11 imageValue = Image.FromFile("images\Logo.gif") ... |
Get Visual Basic 2005 for Programmers: Deitel Developer Series, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.