VB 6 Image control stretching limit problem 
Author Message
 VB 6 Image control stretching limit problem

Magicians of the VB domain I call upon you!

I am trying to zoom in and out of a picture displayed using the image
control in VB 6.

I start a normal Vb application, add a picture box and use it to
contain an image control. I set the image control's picture property
to a normal, unremarkable jpg file and set the control's stretch
property to true.  Then in the image control's mouse down event I add
the following code:

Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
    Image1.Visible = False

    If Button = vbRightButton Then
        Image1.Height = Image1.Height / 2
        Image1.Width = Image1.Width / 2
    End If

    If Button = vbLeftButton Then
        Image1.Height = Image1.Height * 2
        Image1.Width = Image1.Width * 2
    End If

    Image1.Stretch = True
    Image1.Visible = True

    Debug.Print Image1.Height, Image1.Width
End Sub

On running the program:

I press the left mouse button a number of times while over the image
control. The jpg disappears, but the image control still receives the
button presses.  The question is why?
And how can I detect that the next left mouse click is going to make
the jpg disappear?

If I click the right mouse button correspondingly, the picture will
reappear.  Different sized jpgs take different numbers of mouse
presses but produce the same result.

Thanks, DSP

Sat, 23 Apr 2005 21:33:35 GMT  
 [ 1 post ] 

 Relevant Pages 

1. image/picture control - stretch info

2. image/picture control - stretch

3. Q: Limiting form stretch dimensions

4. Image Control file size limit?

5. Apply a stretched image as a listview background

6. Saving image stretch results?

7. auto stretch a image in picturebox to a correct ratio

8. Stretched Image on PictureBox?

9. How to stretch image?

10. Strange Distortion of Image with Stretch = True

11. stretching Images in VB5

12. what algorithm is behind Image Stretch?


Powered by phpBB® Forum Software