BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-16-2007, 10: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, 03: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  




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