BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-16-2007, 11:46 PM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Model: 8800
PIN: N/A
Carrier: GPRS
Posts: 68
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default A problem of drawing lines in a image

Please Login to Remove!

Now I'm learning how to draw a line in a image, using the follows:
public void paint(Graphics g)
{
g.drawImage(img,0,0,null);
if(x != 0 && y != 0)
{
g.drawLine(x-5,y,x+5,y);
g.drawLine(x,y-5,x,y+5);
}
}

but I find there is an problem : when I remove the image in the blackberry screen , the line does not remove at the same time. Finally, I find that,when I remove the image ,I repaint the image , and redraw the line . I change the image position by scroll bar, but the position of line doen not change!
I do not want to change the line coordinate value , because I want to draw the line in the image memory, and add it to the screen, how can I do this??
Please give me some advice , thank you!
Offline  
Old 07-19-2007, 04:52 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Model: 8800
PIN: N/A
Carrier: GPRS
Posts: 68
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Does nobody know how to solve the problem?
help!
Offline  
Closed Thread


Thread Tools

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.