GDI+ Marquee

  • Thread starter Thread starter James
  • Start date Start date
J

James

Hi there,

Can someone give me some pointers on how to build a marquee control?
Basically, I want a something that scrolls both images and text smoothly.

I know I could easily have GDI+ to draw the text and change the coordinates,
but I'm thinking there is a more elegant way?

Arlef
 
Hi,
I know I could easily have GDI+ to draw the text and change the coordinates,
but I'm thinking there is a more elegant way?

Hm... like what? Drawing a marquee without actually drawing a marquee?
Sounds difficult...

Seriously, of course you could create some controls, like labels and
picture boxes, and move their locations around in some creative ways, but
the most that will get you is really bad performance and possibly some ugly
flickering as well. Or you could create and show an animated GIF, but that
is static - or maybe there's a library somewhere that will allow you to
easily create animated GIFs from .NET, dynamically. Not sure if that would
end up having fewer lines of code though...

Unless you're using WPF, I'm afraid you'll have to draw an animation to
show an animation.


Oliver Sturm
 
James,

Not really. GDI doesn't have a great deal of support for animations.
You are going to have to set up the timeline (using a timer, pretty much)
and then modify the contents of your control when the timer fires.

Hope this helps.
 
Back
Top