![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
21/04/2011, 18:37
|
![Avatar de fallen61](http://static.forosdelweb.com/customavatars/avatar385951_1.gif) | | | Fecha de Ingreso: enero-2011
Mensajes: 4
Antigüedad: 14 años Puntos: 0 | |
Respuesta: Problemas con Picturebox Solucionado...
Agregue este codigo al Load, mas las barras de movimiento horizontales y verticales:
Private Sub mnuInsertimage_Click()
Picture2.Picture = LoadPicture
With CommonDialog1
.Filter = "BMP|*.bmp|JPG|*.JPG|GIF|*.GIF"
.DialogTitle = " seleccionar el mapa de bits para cragr en el Picture "
.ShowOpen
If .FileName = "" Then Exit Sub
'Carga la imagen el control Picture
Picture2.Picture = LoadPicture(.FileName)
End With
' -- Cargar imagen
With CommonDialog1
.ShowOpen
If .FileName = "" Then Exit Sub
Picture2.Picture = LoadPicture(.FileName)
End With
' -- Establecer los valores Min y Max a las barras
VScroll1.Value = 0
VScroll1.Max = Picture2.Height - Picture1.Height
HScroll1.Value = 0
HScroll1.Max = Picture2.Width - Picture1.Width
Call VScroll1_Scroll
Call HScroll1_Scroll
VScroll1.LargeChange = Picture2.Height \ 10
HScroll1.LargeChange = Picture2.Width \ 10
VScroll1.SmallChange = Picture2.Height \ 10
HScroll1.SmallChange = Picture2.Width \ 10
HScroll1.Visible = ((Picture2.Width - VScroll1.Width) > (Picture1.Width))
VScroll1.Visible = (Picture2.Height - HScroll1.Height) > (Picture1.Height)
With VScroll1
.Left = Picture1.Width - .Width - 60
.Top = 0
If HScroll1.Visible Then
.Height = (Picture1.Height - HScroll1.Height) - 60
Else
.Height = (Picture1.Height) - 60
End If
.ZOrder 0
End With
With HScroll1
.Left = 0
.Width = Picture1.Width - 60
.Top = (Picture1.Height - .Height) - 60
.ZOrder 0
End With
End Sub
Codigo de las barras de movimiento:
Private Sub Form_Initialize()
Call SetErrorMode(2)
Call InitCommonControls
End Sub
Private Sub HScroll1_Change()
HScroll1_Scroll
End Sub
Private Sub HScroll1_Scroll()
Picture2.Left = Not HScroll1.Value
End Sub
Private Sub VScroll1_Change()
VScroll1_Scroll
End Sub
Private Sub VScroll1_Scroll()
Picture2.Top = Not VScroll1.Value
End Sub
Gracias igual ^^ |