Guest_imported
New member
- Jan 1, 1970
- 0
Hi,
I am trying to calculate the size of a zoomed picture (4 times). However the picturebox tries to size properly but I get an overflow error on my horizontal and vertical scrollbars max methods.
Can someone point out my error, I have tried multiple ways of fixing this bug with no such luck. As well, can someone tell me of a faster way to zoom a picture box as my paintpicture event is slow at 4x magnification. My 2 pictureboxes have a scalemode of pixels.
My sample code is below, thanks in advance!
VScroll1.Max = 0 'init max value of vertical s.bar
'set the scroll bar min and max values
'VScroll1.Max = -Pic(0).Height * 0.75
Debug.Print Pic(0).Height
Debug.Print Pic(1).Height
VScroll1.Max = Pic(1).Height - Pic(0).Height
Debug.Print VScroll1.Max
VScroll1.Min = 0
VScroll1.LargeChange = 50
VScroll1.SmallChange = 25
HScroll1.Enabled = True
HScroll1.Max = 0
'set the scroll bar min and max values
'HScroll1.Max = -Pic(0).Width * 0.75
HScroll1.Max = -(Pic(0).Width - Pic(1).Width)
HScroll1.Min = 0
HScroll1.LargeChange = 100 - HScroll1.Max / 2
HScroll1.SmallChange = 25
frmPreview.Refresh
thanks
newbie_999
I am trying to calculate the size of a zoomed picture (4 times). However the picturebox tries to size properly but I get an overflow error on my horizontal and vertical scrollbars max methods.
Can someone point out my error, I have tried multiple ways of fixing this bug with no such luck. As well, can someone tell me of a faster way to zoom a picture box as my paintpicture event is slow at 4x magnification. My 2 pictureboxes have a scalemode of pixels.
My sample code is below, thanks in advance!
VScroll1.Max = 0 'init max value of vertical s.bar
'set the scroll bar min and max values
'VScroll1.Max = -Pic(0).Height * 0.75
Debug.Print Pic(0).Height
Debug.Print Pic(1).Height
VScroll1.Max = Pic(1).Height - Pic(0).Height
Debug.Print VScroll1.Max
VScroll1.Min = 0
VScroll1.LargeChange = 50
VScroll1.SmallChange = 25
HScroll1.Enabled = True
HScroll1.Max = 0
'set the scroll bar min and max values
'HScroll1.Max = -Pic(0).Width * 0.75
HScroll1.Max = -(Pic(0).Width - Pic(1).Width)
HScroll1.Min = 0
HScroll1.LargeChange = 100 - HScroll1.Max / 2
HScroll1.SmallChange = 25
frmPreview.Refresh
thanks
newbie_999