UI graphics issues: how to get smooth graphics for form and control transitions? 
Author Message
 UI graphics issues: how to get smooth graphics for form and control transitions?

I've run into the following issues with UI graphics in finishing a simple VB
app for a client.

The first issue is with rollover effects.  I'm using the mouseover event to
either hide/unhide, change the Z-order of image controls or change the
font/color of label controls to get a rollover effect.  The effect works
well except that there is a flicker which kind of looks like a black
rectangle the size of the control.  The flicker is barely noticeable on a
~1GHz machine but is very noticeable on a 233Mhz machine.  I found
suggestions to change the controls between LockWindow and UnlockWindow API
calls in user32 but implementing this didn't seem to make a difference.  We
have a similar issue with a simple label control when the text is changed to
implement a counter.

The other issue is a heavy black/red form image that appears briefly when
going from one form to another.  This is also only noticeable on slower
machines.  It also happens if I minimize another app, (word, IE) that is on
top of a VB form.  It seems like the form is getting redrawn in at least 2
passes and the first pass gives a real ugly effect for a moment.  I've tried
both unloading the old form before and after showing the new form with no
visible difference.  I only see these effects when redrawing VB apps:
minimizing word over IE does not result in this effect redrawing IE for
example.

I'm looking for some flicker free controls to buy as it looks cheaper for
the company than paying me to write them in C++.  A strategy for eliminating
the ugly form transitions would be to redo the app as one form, creating and
destroying whole sets of controls on the same form to transition between
what are now separate forms.  While I think this will work, it looses a lot
of the RAD benefit of VB for building and maintaining the application.
Instead of visually moving the controls and changing their parameters on the
form, I'd be writing and maintaining code that programmatically creates and
configures controls.

I'm amazed that I never noticed these seemingly generic and obviously ugly
UI features of VB before and there are not well known ways to deal with
them.  To the client, they are a serious problem, especially because of the
superb graphics of an initial Macromedia Director prototype of the
application.

Thanks




Tue, 02 Nov 2004 05:10:40 GMT  
 UI graphics issues: how to get smooth graphics for form and control transitions?

Quote:
> I've run into the following issues with UI graphics in finishing a simple
VB
> app for a client.

<Snip>

Grab the (free) GUIButton control off my site which will handle the button
rollovers for you.  As far as the flickering goes, you've not mentioned
where the black/red image is coming from?  I assume it's your background
graphic, which is usually excluded by other controls during runtime?  If so
then either remove the background graphic or paint the area's under the
controls with the system's button face colour at runtime, setting the
AutoRedraw property may also help the background graphic being drawn
properly.
It sounds to me like if it's drawing twice then there's too much graphically
on the form or it's making repaint calls somewhere through code, try
streamlining the application or re-thinking the UI.
It's very possible to write a nice user interface in VB, and with some
thought it would probably be untirely possible to completely re-create the
director presentation, like-for-like.
Hope this helps,

    Mike

 -- EDais --

 - Microsoft Visual Basic MVP -
WWW: Http://EDais.earlsoft.co.uk/




Tue, 02 Nov 2004 09:14:25 GMT  
 UI graphics issues: how to get smooth graphics for form and control transitions?
Thank you VERY much Mike.  The ugly black/red momentary redraw of the form
was due to the background image which covered the whole form.  What helped
was reducing the background image to the 1/5 of the screen that wasn't a
solid color and really needed the background image.  This minimized the area
of the ugly effect and shortened the time of it, but did not eliminate it.
Using an image control for the background also did not eliminate the effect.

Your button handles the rollovers nicely without flicker.  I also downloaded
an evaluation copy of ImpulseSudio's components which have very nice flicker
free graphics that address our flicker problems with buttons and changing
label controls.  I can also use their container control for the background
image which eliminates the form transition effect.

Thanks for the help and inspiration in getting smooth graphics in VB!



Quote:
> > I've run into the following issues with UI graphics in finishing a
simple
> VB
> > app for a client.

> <Snip>

> Grab the (free) GUIButton control off my site which will handle the button
> rollovers for you.  As far as the flickering goes, you've not mentioned
> where the black/red image is coming from?  I assume it's your background
> graphic, which is usually excluded by other controls during runtime?  If
so
> then either remove the background graphic or paint the area's under the
> controls with the system's button face colour at runtime, setting the
> AutoRedraw property may also help the background graphic being drawn
> properly.
> It sounds to me like if it's drawing twice then there's too much
graphically
> on the form or it's making repaint calls somewhere through code, try
> streamlining the application or re-thinking the UI.
> It's very possible to write a nice user interface in VB, and with some
> thought it would probably be untirely possible to completely re-create the
> director presentation, like-for-like.
> Hope this helps,

>     Mike

>  -- EDais --

>  - Microsoft Visual Basic MVP -
> WWW: Http://EDais.earlsoft.co.uk/





Wed, 03 Nov 2004 05:01:15 GMT  
 UI graphics issues: how to get smooth graphics for form and control transitions?
Quote:
> Thank you VERY much Mike.  The ugly black/red momentary redraw of the form
> was due to the background image which covered the whole form.  What helped
> was reducing the background image to the 1/5 of the screen that wasn't a
> solid color and really needed the background image.  This minimized the
area
> of the ugly effect and shortened the time of it, but did not eliminate it.
> Using an image control for the background also did not eliminate the

effect.

Oh no no no, never use an image control if you're at all worried about
flicker - It's terrible!  A picture box would be far better, and if you set
the AutoRedraw property to true then it performs basic double buffering
internally so you never get flickering (Unless you specifically tell it to
;) and it rarely tears apart from at high refresh rates.

Quote:
> Your button handles the rollovers nicely without flicker.  I also
downloaded
> an evaluation copy of ImpulseSudio's components which have very nice
flicker
> free graphics that address our flicker problems with buttons and changing
> label controls.  I can also use their container control for the background
> image which eliminates the form transition effect.

Label controls are also a problematic one...  Like the Image control they're
"windowless" which means that rather then having their own window which can
be told to redraw only when it needs to be, they rely on their parent window
and only redraw _after_ they have.  As such you get a {*filter*} flicker between
the time the parent draws and the time the text/image is drawn.  For
flickerless text, simply use the API GDI calls for drawing text (TextOut(),
DrawText() etc) and they'll only redraw if and when you tell them to, using
these in conjunction with the AutoRedraw property of the Form/Picture box
object will result in text that never flickers.

Quote:
> Thanks for the help and inspiration in getting smooth graphics in VB!

No problem - It's what we're here for :)
Hope this helps,

    Mike

 -- EDais --

 - Microsoft Visual Basic MVP -
WWW: http://www.*-*-*.com/




Wed, 03 Nov 2004 05:48:44 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. UI graphics issues: how to get smooth graphics for form and control transitions?

2. Smooth transition between forms?

3. Smooth transition from one form to the next ??

4. Graphic Transitions

5. Graphics transitions

6. Good (free) windows UI widgets/graphics?

7. graphics filter to convert array(x,y) to standard graphics

8. Saving graphics objects to an standard graphics file

9. Graphic example - 'smart' connected graphic objects

10. Graphic example - 'smart' connected graphic objects

11. Overlaying text onto a graphic and saving as graphic

12. How to overlay graphics on text/graphics

 

 
Powered by phpBB® Forum Software