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
LVL 42
Meir RivkinFull stack Software EngineerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
itsmeandnobodyelseConnect With a Mentor Commented:
In OnTimer invalidate that part of the screen that you wants to get refreshed, e. g. by InvalidateRect function. Then in OnPaint (or OnDraw) you should draw the invalidated region only e. g. by BitBlt to a compatible device/bitmap.

Regards, Alex
0
 
bdunz19Commented:
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
0
 
Meir RivkinFull stack Software EngineerAuthor Commented:
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()?

0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
bdunz19Commented:
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
0
 
Meir RivkinFull stack Software EngineerAuthor Commented:
i'm loading the image and each time i draw only portion of it to the device context.
0
 
Meir RivkinFull stack Software EngineerAuthor Commented:
itsmeandnobodyelse: 10x for the reply but i need some source code cause i'm pretty 'green' in this area

cheers
0
 
itsmeandnobodyelseCommented:
>>>> 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
0
All Courses

From novice to tech pro — start learning today.