Hello,
I am currently upgrading a VB6 application to ASP.NET........ does anybody know the follow equivalent code for ASP.NET? Basically there's 2 pictureboxes using VB6 one inside of the other and as you scroll or zoom in an image......it resises the image.
Do pictureboxes exist in webforms? It doesn't look like it or can the Image control work?
VB Code:
'Method that does the zoom Public Sub ZoomPicture(pct As PictureBox, zoom As Double) With pct .Width = .Width * zoom .Height = .Height * zoom .PaintPicture .Picture, 0, 0, .ScaleWidth, .ScaleHeight End With End Sub 'Zoom in Private Sub cmdPlus6_Click() ZoomPicture Picture12, 1.1 Picture12.AutoRedraw = True End Sub 'zoom out Private Sub cmdMinus6_Click() ZoomPicture Picture12, 0.9 Picture12.AutoRedraw = True End Sub Private Sub HScroll6_Change() Picture12.Move 0 - HScroll6.Value End Sub Private Sub HScroll6_Change() Picture12.Move 0 - HScroll6.Value End Sub Private Sub ArrangeScrollBars6() ' Resize scroll bars to fit form, and set their max value (in relation to form size) With HScroll6 .Move 0, Picture11.ScaleHeight - .Height, Picture11.ScaleWidth - VScroll6.Width .Max = IIf((Picture12.ScaleWidth - Picture11.Width + VScroll6.Width) > 0, _ Picture12.Width - Picture11.ScaleWidth + VScroll6.Width, 0) .SmallChange = IIf(Int(.Max / 10) > 0, Int(.Max / 10), 1) .LargeChange = IIf(Int(.Max / 5) > 0, Int(.Max / 5), 1) End With With VScroll6 .Move Picture11.ScaleWidth - .Width, 0, .Width, Picture11.ScaleHeight - HScroll6.Height .Max = IIf((Picture12.Height - Picture11.ScaleHeight + HScroll6.Height) > 0, _ Picture12.Height - Picture11.ScaleHeight + HScroll6.Height, 0) .SmallChange = IIf(Int(.Max / 10) > 0, Int(.Max / 10), 1) .LargeChange = IIf(Int(.Max / 5) > 0, Int(.Max / 5), 1) End With With Text1 .Left = HScroll6.Width .Top = VScroll6.Height .ZOrder 0 End With End Sub
Thanks in advance!
Chris
P.s. Anybody know a website that shows conversion tables between vb6 and vb.net?




Reply With Quote