Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

gradient text

Posted on 2006-11-22
7
Medium Priority
?
563 Views
Last Modified: 2012-05-05
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
0
Comment
Question by:Meir Rivkin
  • 3
  • 2
  • 2
7 Comments
 
LVL 4

Expert Comment

by:bdunz19
ID: 18001311
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
 
LVL 42

Author Comment

by:Meir Rivkin
ID: 18001573
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
 
LVL 4

Expert Comment

by:bdunz19
ID: 18002058
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 42

Author Comment

by:Meir Rivkin
ID: 18002074
i'm loading the image and each time i draw only portion of it to the device context.
0
 
LVL 39

Accepted Solution

by:
itsmeandnobodyelse earned 1000 total points
ID: 18002566
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
 
LVL 42

Author Comment

by:Meir Rivkin
ID: 18002589
itsmeandnobodyelse: 10x for the reply but i need some source code cause i'm pretty 'green' in this area

cheers
0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 18003565
>>>> 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

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question