Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

moving image control flickers.....

0 views
Skip to first unread message

mrkkong

unread,
Jun 22, 2001, 8:40:50 PM6/22/01
to
I know I have posted this before, but I have not gotten the response I had
hoped for....

I have an image control with a transparent gif image inside of it(I can't
use the picturebox because it is transparent), and the placement of the
image control is controlled by a timer, and the timer's interval is at 100,
and the timer moves the image 10 pixels at a time. The picture flickers with
the white part(the transparent part) flickering every other time it moves.
The last response said I should use Bitblt, but as far as I know, the
control has to have an Hdc and it moves the picture between controls, where
I want to move the control itself. Any suggestions would be great.


Larry Serflaten

unread,
Jun 22, 2001, 10:49:25 PM6/22/01
to

"mrkkong" <mrk...@home.com> wrote \

> I have an image control with a transparent gif image inside of it(I can't
> use the picturebox because it is transparent), and the placement of the
> image control is controlled by a timer

> The picture flickers with
> the white part(the transparent part) flickering every other time it moves.

> I want to move the control itself. Any suggestions would be great.

You won't get good graphics from windows, there always seems to be
some redrawing issues when moving controls around. You might have
better luck if you used a different type of transparent picture.

Try an icon, instead of a GIF picture, the image control supports their
transparency. For a demo add a timer and an image control then
try this code:

HTH
LFS

Private Sub Form_Load()
AutoRedraw = True
ScaleMode = vbTwips
Move Left, Top, 8000, 1300
Line (1200, 400)-Step(5600, 200), vbYellow, BF
Line (1200, 400)-Step(5600, 200), vbBlue, B
PSet (1630, 300), BackColor
Font.Size = 14
Font.Bold = True
Print "Does this image appear to flicker?"
Image1 = Icon
Image1.Move 1199, 210
Timer1.Interval = 63
End Sub

Private Sub Timer1_Timer()
Static DX As Long
Dim IX As Long
IX = Image1.Left + DX * 3 * Screen.TwipsPerPixelX
Image1.Left = IX
If IX < 1200 Then DX = 1
If IX > 6400 Then DX = -1
End Sub

Billy Joe

unread,
Jun 23, 2001, 12:15:18 AM6/23/01
to
VB and 18 interrupts per second alone won't provide good animation. One
reason: the eye resolves motion at 20+ frames per second. That's why
broadcast TV has used 30fps interlaced for the past 60+ years.
I wanted to do a snood like thingy in VB (as it is the only PC language of
which I have the slightest clue - very slight) and came quickly to the
conclusion that even if I could get one GIF to dance to my choreography, the
others would all be wallflowers!!!
Now, I'm sure there is a DLL written in Assembler, or C, or any of its
offspring that may do the job. But VB is far from the animators dream! Use
a language appropriate to the task!
Regards,
Billy Joe

"mrkkong" <mrk...@home.com> wrote in message
news:OmaBrz3#AHA.1960@tkmsftngp03...

mrkkong

unread,
Jun 23, 2001, 2:43:14 PM6/23/01
to
Thanks!! Works much better now!
"Larry Serflaten" <serf...@usinternet.com> wrote in message
news:#PxGQ74#AHA.1628@tkmsftngp05...

Jeff Johnson

unread,
Jun 23, 2001, 3:10:36 PM6/23/01
to

"Billy Joe" <BillyJoe...@netzero.net> wrote in message
news:#vtUZs5#AHA.1236@tkmsftngp07...

> But VB is far from the animators dream! Use
> a language appropriate to the task!

I agree for the most part, but since DirectX now has VB support, I'm sure
you could get much better results if you're willing to brave the learning
curve.


Larry Serflaten

unread,
Jun 23, 2001, 4:52:36 PM6/23/01
to

"Jeff Johnson" <pawp...@com.geocities> wrote

> > But VB is far from the animators dream! Use
> > a language appropriate to the task!
>
> I agree for the most part, but since DirectX now has VB support, I'm sure
> you could get much better results if you're willing to brave the learning
> curve.
>

One of the first things I plan to 'play' with, in .Net beta2 !!!

:-)
LFS

0 new messages