8. IMAGE
Transcript of 8. IMAGE
![Page 1: 8. IMAGE](https://reader036.fdocuments.in/reader036/viewer/2022083004/55cf9727550346d0338ff9ea/html5/thumbnails/1.jpg)
IMAGE
Especifique cuales son los tipos de ficheros que utiliza la clase Image. Desarróllalo a través de este medio.
Clase base abstracta que proporciona funcionalidad para las clases Bitmap, Icon y
Metafile
Ejemplos
IMAGE:
Espacio de nombres: System.Drawing
Ensamblado: System.Drawing (en System.Drawing.dll)
'VISUAL BASICPrivate Sub ImageExampleForm_Paint _ (ByVal sender As System.Object, _ ByVal e As System.Windows.Forms.PaintEventArgs) _ Handles MyBase.Paint
' Create image. Dim newImage As Image = Image.FromFile("SampImag.jpg")
' Create Point for upper-left corner of image. Dim ulCorner As New Point(100, 100)
' Draw image to screen. e.Graphics.DrawImage(newImage, ulCorner)End Sub
![Page 2: 8. IMAGE](https://reader036.fdocuments.in/reader036/viewer/2022083004/55cf9727550346d0338ff9ea/html5/thumbnails/2.jpg)
BITMAP
Espacio de nombres: System.Drawing
Ensamblado: System.Drawing (en System.Drawing.dll)
'VISUAL BASIC
Dim image1 As Bitmap
Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click
Try ' Retrieve the image. image1 = New Bitmap( _ "C:\Documents and Settings\All Users\Documents\My Music\music.bmp", _ True)
Dim x, y As Integer
' Loop through the images pixels to reset color. For x = 0 To image1.Width - 1 For y = 0 To image1.Height - 1 Dim pixelColor As Color = image1.GetPixel(x, y) Dim newColor As Color = _ Color.FromArgb(pixelColor.R, 0, 0) image1.SetPixel(x, y, newColor) Next Next
' Set the PictureBox to display the image. PictureBox1.Image = image1
' Display the pixel format in Label1. Label1.Text = "Pixel format: " + image1.PixelFormat.ToString()
Catch ex As ArgumentException MessageBox.Show("There was an error." _
![Page 3: 8. IMAGE](https://reader036.fdocuments.in/reader036/viewer/2022083004/55cf9727550346d0338ff9ea/html5/thumbnails/3.jpg)
& "Check the path to the image file.") End TryEnd Sub