Visual Basic - MEDICION DE UNA LINEA AYUDA!!!!

Life is soft - evento anual de software empresarial
 
Vista:

MEDICION DE UNA LINEA AYUDA!!!!

Publicado por ANNA (45 intervenciones) el 28/06/2006 19:20:06
EL CODIGO ES EL SIGUIENTE, LO Q HACE ES ADQUIRIR UNA IMAGEN, Y DIBUJAR UNA LINEA SOBRE LA IMAGEN, ESA LINEA ES LA Q NECESITO MEDIR EN CENTIMETROS Y MOSTRARLO EN UN LABEL P DESPUES HACER OTROS CALCULOS.......... HELP!!

Dim X0 As Single, Y0 As Single
Private Sub Command1_Click()
image1.Stretch = False
End Sub
Private Sub Form_Load()
image1.Picture = Form1.image1.Picture
Form2.Caption = Form1.File1.FileName
OldX = 0
OldY = 0

' Posicion Inicial de las imagenes
Image2.Move 0, 0, ScaleWidth - VScroll1.Width, ScaleHeight - HScroll1.Height
image1.Move 0, 0

' posicion inicial scrollbar horizontal
HScroll1.Top = Image2.Height
HScroll1.Left = 0
HScroll1.Width = Image2.Width

' posicion inicial scrollbar vertical
VScroll1.Top = 0
VScroll1.Left = Image2.Width
VScroll1.Height = Image2.Height

'Determina si la imagen se sobresale de la pantalla,
'sino, deja de hacer visible las scrollbar

VScroll1.Visible = (Image2.Height < image1.Height)
HScroll1.Visible = (Image2.Width < image1.Width)
End Sub
Sub HScroll1_Change()
' Picture2.Left is set to the negative of the value because
' as you scroll the scroll bar to the right, the display
' should move to the Left, showing more of the right
' of the display, and vice-versa when scrolling to the
' left.
image1.Left = -HScroll1.Value
End Sub
Private Sub image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
X0 = X
Y0 = Y
End Sub
Private Sub image1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.image1.Line (X0, Y0)-(X, Y), 0
End Sub
Sub VScroll1_Change()
' Picture2.Top is set to the negative of the value because
' as you scroll the scroll bar down, the display
' should move up, showing more of the bottom
' of the display, and vice-versa when scrolling up.
image1.Top = -VScroll1.Value
End Sub
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
GetCursorPos Pnt
Text1.Text = Pnt.X
Text2.Text = Pnt.Y
NewX = Pnt.X
NewY = Pnt.Y
End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder