Solved

gradient text

Posted on 2006-11-22
7
549 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Quicksort a dynamic deque 33 66
computer science syllabus 3 70
Which Linux flavors will this run on? 6 76
Beginner to Unreal Engine 4 5 61
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

895 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

12 Experts available now in Live!

Get 1:1 Help Now