A problem of drawing on WVGA screen.

Put your problem here if it does not fit any of the other categories.

A problem of drawing on WVGA screen.

Postby chengzh » Thu Jan 07, 2010 2:35 pm

Hi all:
I wrote a reading software. I implemented the page turning effect when user tap the screen to turn to next/pre page. The display is ok on G1(320X200 size) but it can not works well on Droid(480*854 size), the font looks a litter fuzzy, not clear as G1.
I explain my codes for page turning:
1) create a canvas A
2) create bitmap.
3) set bitmap on canvas A
4) draw the new page content on canvas A
5) the current showing page has been saved in bitmap before since we do from step 1) to setp 4),
6) In order to implement the turning effect of scrolling from left to right, I draw the old bitmap part and draw the new bitmap part until the whole new bitmap has been drawn. all of bitmaps are drawing by canvas.drawBitmap() in onDraw() function.
7) when step 6) is done, it means the new page has been shown on screen, and the bitmap has been saved to use in next page turning.

The above is the whole actions for my page turning. On G1, no problem. But on Droid phone, the font is not clear,
I tried if I directly draw text by canvas in OnDraw() not through bitmap, It is ok, but it can not implement the page turning effect that I need. I don't know why, could you please help me to take a look and tell me where is wrong or miss some steps?
Thanks a lot!
chengzh
Freshman
Freshman
 
Posts: 2
Joined: Thu Jan 07, 2010 2:14 pm

Top

Postby chengzh » Thu Jan 07, 2010 4:13 pm

A simple codes can be like this:
in my draw fucntion:
void myDraw(...) {
Canvas a = new Canvas();
mBitmap = new Bitmap();
a.setBitmap(mBitmap);
a.drawText(...).
// draw something I need
}

void onDraw(..) { // override view.onDraw()
myDraw(..);

// directly draw the bitmap which is already ready in myDraw()
canvas.drawBitmap(mBitmap);
....
}

If we draw like this, the font will not clear on Droid. Why????
Please help me, thanks!
chengzh
Freshman
Freshman
 
Posts: 2
Joined: Thu Jan 07, 2010 2:14 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 21 guests