
12/10/2006, 18:29
|
| | Fecha de Ingreso: abril-2005
Mensajes: 44
Antigüedad: 19 años, 10 meses Puntos: 0 | |
ps ya lo hice por si alguien en algun momento se intereso le dejo el codigo
Código:
Imports System
Imports System.Drawing
Imports System.Windows.Forms
Public Class CargarImagen
Inherits Form
Private Img As Image 'imagen
Public X1 As Integer = 0 'posicion inicial en x
Public Y1 As Integer = 0 'posicion inicial en y
Sub New(ByVal Ruta As String, Optional ByVal Encabezado As String = "", Optional ByVal X As Integer = 0, Optional ByVal Y As Integer = 0)
Img = Image.FromFile(Ruta)
X1 = X 'por si kiere especificar otro punto de inicio
Y1 = Y 'ke no sea 0,0
Dim grfxImage As Graphics = Graphics.FromImage(Img)
Dim Szf As SizeF = grfxImage.MeasureString(Encabezado, Font)
BackColor = SystemColors.Window
ForeColor = SystemColors.WindowText
ResizeRedraw = True
End Sub
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Dibuja(e.Graphics, ForeColor, ClientSize.Width, ClientSize.Height)
End Sub
Public Sub Dibuja(ByVal Grfx As Graphics, ByVal Clr As Color, ByVal cX As Integer, ByVal cY As Integer)
Grfx.DrawImage(Img, X1, Y1)
End Sub
End Class
|