You Are Here:

Community: Developer Discussion Boards

#1 Old RE: Why real 7650 doesn't support setting color of drawing strings ? - 1970-01-01, 02:00

Join Date: Mar 2003
Posts: 6
GaryWu
Offline
Registered User
Hi, i have the same problem with u on version 4.30 traditional chinese platform.

When i type *#0000#
the following text is shown

v4.30
23-09-02
NHL-2NA

Are there any solutions?
Thanks a lot.
Reply With Quote

#2 Old Why real 7650 doesn't support setting color of drawing strings ? - 2002-11-07, 01:56

Join Date: Mar 2003
Posts: 4
wu_kun
Offline
Registered User
Hi all:

I got a problem when setting colors for drawing stringsinstring via off-line graphics, which is low-level UI, like this:

"
protected void paint(Graphics g)
{
...

// get the double-buffer off-line screen

offImg = DirectUtils.createImage(getWidth(), getHeight(), 0x00000000);
offG = offImg.getGraphics();

// set color as White
offG.setColor(255, 255, 255);

scoreStr = "Your score is perfect.";

offG.drawString(scoreStr, getWidth() / 2, getHeight() / 2, Graphics.HCENTER | Graphics.BOTTOM);


// flush off-line screen to on-line screen
g.drawImage(offImg,0,0,Graphics.TOP|Graphics.LEFT);


...
}
"

On the emulator, which is included in Nokia series 60 MIDP SDK, this code runs as I wish and the string is drewn in the color as I setted.

But, when run on real 7650, the color of string is always Black, whichever color I changed in code.

Can somebody tell me what's wrong with color setting for string drawing in real 7650 ?



Thanks.
Reply With Quote

#3 Old RE: Why real 7650 doesn't support setting color of drawing strings ? - 2002-11-13, 12:41

Join Date: Mar 2003
Posts: 419
Location: Irving, Texas, USA
pbergius
Offline
Regular Contributor
Hello,

I tried it on Nokia 7650 with version 3.12 sw. It works as it should. What is your sw version (type *#0000# to get it)?

Please find below my code snippet:
public void paint(Graphics g) {
Image offImg = DirectUtils.createImage(getWidth(), getHeight(), 0x00FF0000);
Graphics offG = offImg.getGraphics();

// set color as White
offG.setColor(255, 255, 255);

String scoreStr = "Your score is perfect.";

offG.drawString(scoreStr, getWidth() / 2, getHeight() / 2, Graphics.HCENTER | Graphics.BOTTOM);
g.drawImage(offImg,0,0,Graphics.TOP|Graphics.LEFT);

Regards,

Petteri / Forum Nokia
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia