Re: Aaarrrggghhh -- that ugly flicker!

From: [SolarAngel] (not-for-mail)
Date: 10/05/04


Date: Tue, 5 Oct 2004 23:28:56 +0200

USE BUFFERED DRAW

draw to memory than when drawing is done draw back to hDC,
also try not to make memory leaks (resources, handles), destroy all handles when you done.
I had similar problems with drawing, search interenet and MSDN for Flicker Free example how to do it.

[SolarAngel]

"mr unreliable" <ReplyToNewsgroup@notmail.com> wrote in message news:#P7nrCLqEHA.2724@TK2MSFTNGP14.phx.gbl...
| hi gang,
|
| I constructed a "fake" statusbar, using a picbox aligned to the bottom of my
| form, and using api's to draw in the panels and text. This works well
| enough.
|
| Then I wanted to add some icons to the (fake) statusbar panels. I extracted
| the icons from a system dll, and used an Image control(s) to display them.
| I set the Image control's "parent" (i.e., container) to be the picbox, so
| that the icons would "float" (appear on top) over the (fale) statusbar.
| This works well enough, too.
|
| The icons were 32x32, but the image in my (fake) statusbar has to be 16x16,
| so I used the "stretch" (or in this case shrink) property of the Image
| control to get the icons to fit into the statusbar panels. This works too.
|
| Now the problem. The picbox has to be set to "AutoRedraw", in order to
| "persist" the graphics that I am drawing with the api's. However, every
| time the statusbar is updated, the icon in the Image control will "flicker".
|
| I am not sure what is going on here, but I suspect that vb (the runtimes?)
| is redrawing the icon in the Image control, and probably going to the
| trouble of re-shrinking it in the process, for every time it redraws the
| picbox. Or, perhaps vb is redrawing the picbox, and then redrawing the
| Image control on top. Anyway...
|
| Can anybody explain what is going on "under-the-covers"? And, hopefully,
| can anybody suggest a way to avoid that ugly "flicker".
|
| tiafah, jw
|
| p.s. I am aware that Steve McMahon has done something like this on his
| website, with his lite weight statusbar example. But Steve did it all with
| api's, and I was hoping to use more of the capabilities of "standard" vb to
| get the job done...
|
|



Relevant Pages

  • Re: Aaarrrggghhh -- that ugly flicker!
    ... USE BUFFERED DRAW ... | I constructed a "fake" statusbar, using a picbox aligned to the bottom of my ... | the icons from a system dll, and used an Image controlto display them. ... | time the statusbar is updated, the icon in the Image control will "flicker". ...
    (microsoft.public.vb.winapi)
  • Aaarrrggghhh -- that ugly flicker!
    ... using a picbox aligned to the bottom of my ... Then I wanted to add some icons to the statusbar panels. ... the icon in the Image control will "flicker". ...
    (microsoft.public.vb.general.discussion)
  • Aaarrrggghhh -- that ugly flicker!
    ... using a picbox aligned to the bottom of my ... Then I wanted to add some icons to the statusbar panels. ... the icon in the Image control will "flicker". ...
    (microsoft.public.vb.winapi)
  • Re: extracticon api using vba (in Word or Excel)
    ... By pasting in the two extra api ... The rest of the code worked & I got a nice neat row of icons on my form - ... pasted into the image control on the form. ... >> draw the icon on. ...
    (microsoft.public.word.vba.general)
  • Re: Drawing of PNGs with transparent pixels
    ... ImageList.Draw() to draw the image instead of Graphics.DrawImage. ... To enable icons in menus, ... > image to a PictureBox control. ... > What seems unlogical to me is that other controls like ToolBarButton draw ...
    (microsoft.public.dotnet.framework.drawing)