Link to home
Start Free TrialLog in
Avatar of Meir Rivkin
Meir RivkinFlag for Israel

asked on

gradient text

hi experts,

I'm developing custom controls for mobile devices running windows CE 4.2/5.0 (no MFC libs)
having a gradient background is fairly simple, however, i was trying to draw a gradient text on a screen without success.
any ideas?

cheers
Avatar of bdunz19
bdunz19

Well, I have and idea that might satisfy. This comes from video game development, where most character sets used to comprise of one large bitmap of every letter/number/symbol drawn in something like photoshop and then extracted from the bitmap and BitBlt onto the screen. Now, I have very little experience with mobile dev, and do not know what the processing power of simple drawing takes, but i'm willing to bet if you are performing gradient backgrounds then this solution should be a breeze.

So basically, type out the entire character set in one long row and then use some gradient effects over the font and save it with a mask color as the background. Then load the bmp and with a fairly simple algorithm extract the specified character for whatever letter you need to draw.

Just my two cents, hope they help!
Brandon
Avatar of Meir Rivkin

ASKER

ok, we've decided that since the gradient colors are fixed the best and fastest way is to create the bitmap with the gradient text as a resource.
then using timer, display partial of the bitmap as the time progresses.
my question is how do i implement this in OnTimer()?

Are you saying you want the text to fade in and out sort of? I'm kind of lost about your last comment... please clarify
i'm loading the image and each time i draw only portion of it to the device context.
ASKER CERTIFIED SOLUTION
Avatar of itsmeandnobodyelse
itsmeandnobodyelse
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
itsmeandnobodyelse: 10x for the reply but i need some source code cause i'm pretty 'green' in this area

cheers
>>>> but i need some source code

Did you use MFC or plain WinAPI? Can you post the OnTimer til now? If you have a handler for WM_PAINT please post it also (normally OnPaint or OnDraw) cause there are different ways to do the same thing.


>>>> i'm loading the image and each time i draw only portion of it to the device context.

Did you write already some piece of code for that?


Regards, Alex