GDI+ Marquee

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
 
O

Oliver Sturm [MVP C#]

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
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top