Solved

gradient text

Posted on 2006-11-22
7
548 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:sedgwick
  • 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:sedgwick
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 42

Author Comment

by:sedgwick
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 250 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:sedgwick
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
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 goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now