Flickering imagebox 
Author Message
 Flickering imagebox
I have an imagebox which i move a using the arrow keys.
Here is my code:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
        Case vbKeyLeft
        imgSlide.Left = imgSlide.Left - 200
        Case vbKeyRight
        imgSlide.Left = imgSlide.Left + 200
        Case vbKeyUp
        imgSlide.Top = imgSlide.Top - 200
        Case vbKeyDown
        imgSlide.Top = imgSlide.Top + 200
    End Select
End Sub

The problem is that the image flickers while moving. Is there anyway to get
rid of the flickering?

Thanks

Alex



Thu, 03 Jul 2003 22:50:59 GMT  
 Flickering imagebox


Quote:
>I have an imagebox which i move a using the arrow keys.
>Here is my code:
[Snip]
>The problem is that the image flickers while moving. Is there anyway to get
>rid of the flickering?

Hi Alex. I tried four different ways of solving your prob but they all
failed :-(

However, number five! Just a possibility for you.

(VB6, 500MHz Pentium III, 128MB RAM)

A new .exe with a .jpg 217 pixels W X 300 pixels H as Form1.Picture,
AutoRedraw = False, BorderStyle = None. Then used something very much
like your code to move it around...

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
        Case vbKeyLeft
                Move Left - 200
        Case vbKeyRight
                Move Left + 200
        Case vbKeyUp
                Move Left, Top - 200
        Case vbKeyDown
                Move Left, Top + 200
    End Select
End Sub

Result? No significant picture break up at all on moving it around.

Only a suggestion.

Regards.

--
Martin Trump



Fri, 04 Jul 2003 02:31:18 GMT  
 Flickering imagebox
You're saying use a form instead on an image box yeah? I think a picture box
doesn't flicker anyway. I wanted to know if you could get a imagebox to stop
flickering 'cos otherwise i'd have to chage loads of controls.

Thanks again

Alex


Quote:


> >I have an imagebox which i move a using the arrow keys.
> >Here is my code:
> [Snip]
> >The problem is that the image flickers while moving. Is there anyway to
get
> >rid of the flickering?

> Hi Alex. I tried four different ways of solving your prob but they all
> failed :-(

> However, number five! Just a possibility for you.

> (VB6, 500MHz Pentium III, 128MB RAM)

> A new .exe with a .jpg 217 pixels W X 300 pixels H as Form1.Picture,
> AutoRedraw = False, BorderStyle = None. Then used something very much
> like your code to move it around...

> Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
>     Select Case KeyCode
>         Case vbKeyLeft
>                 Move Left - 200
>         Case vbKeyRight
>                 Move Left + 200
>         Case vbKeyUp
>                 Move Left, Top - 200
>         Case vbKeyDown
>                 Move Left, Top + 200
>     End Select
> End Sub

> Result? No significant picture break up at all on moving it around.

> Only a suggestion.

> Regards.

> --
> Martin Trump



Fri, 04 Jul 2003 05:31:55 GMT  
 Flickering imagebox


Quote:
>You're saying use a form instead on an image box yeah? I think a picture box

Yes, I was. If you find a better way, please let us know.

Regards,

--
Martin Trump



Fri, 04 Jul 2003 06:00:08 GMT  
 Flickering imagebox
Have you tried setting the imagebox visibility to false before you
move, then to true after the move?  I had a similar situation with
flickering before and that worked for me.

Jennifer



Quote:
> I have an imagebox which i move a using the arrow keys.
> Here is my code:

> Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
>     Select Case KeyCode
>         Case vbKeyLeft
>         imgSlide.Left = imgSlide.Left - 200
>         Case vbKeyRight
>         imgSlide.Left = imgSlide.Left + 200
>         Case vbKeyUp
>         imgSlide.Top = imgSlide.Top - 200
>         Case vbKeyDown
>         imgSlide.Top = imgSlide.Top + 200
>     End Select
> End Sub

> The problem is that the image flickers while moving. Is there anyway
to get
> rid of the flickering?

> Thanks

> Alex

Sent via Deja.com
http://www.deja.com/


Fri, 04 Jul 2003 10:47:56 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. IMAGEbox dropped onto another imagebox flakey

2. Populate ImageBox Control on a VB Form

3. Taking Pictures from Word and Populating Imageboxes in a Userform

4. changing each pixel in ImageBox one at a time

5. Active X Component (Using ImageBox)

6. PaintPicture - quality of compression for printer and Imagebox

7. Smooth movement of an ImageBox

8. Detecting and changing color of the gif file in picturebox or imagebox

9. ImageBox or PictureBox

10. Copy ImageBox to PictureBox

11. Problem Loading JPEG's in ImageBox

12. multiple imagebox animation

 

 
Powered by phpBB® Forum Software