06-08-2012 06:28 AM
here is my code:
my image thread connection : LINE 126
i am trying to display image in ListField
Can someone please help me out with this. The format of what I'm trying is something like this
------------
| image | LabelField1
| | LabelField2
-------------
Thanks.
06-08-2012 07:17 AM
06-08-2012 07:37 AM
in drawListRow i try this
path = (String) imagePaths.elementAt(index);
bit = connectServerForImage(path);
Bitmap CHECKMARK_IMAGE = Bitmap.getBitmapResource("img/aristo.jpg");
if (bit == null) { bit = CHECKMARK_IMAGE; }
g.drawBitmap(xText, y + yText, 80, 200, bit, 0, 0);but can't scroll smoothly throughout the list. Any idea, comments.
06-08-2012 07:48 AM
06-08-2012 08:03 AM
i also try this
private class imgConnection extends Thread
{
public imgConnection() {
super();
}
public void run() {
try {
for (int i = 0; i < imagePaths.size(); i++)
{
final int index = i;
String path = imagePaths.elementAt(index).toString();
bit = connectServerForImage(path);
Bitmap CHECKMARK_IMAGE = Bitmap.getBitmapResource("img/aristo.jpg");
if (bit == null) { bit = CHECKMARK_IMAGE; }
bit = resizeBitmap(bit, 70, 70);
image.addElement(bit);
}
}
catch (Exception e)
{
System.out.println(e.toString());
}
UiApplication.getUiApplication().invokeLater(new Runnable() {
public void run() {
_list.setSize(image.size());
subManager.add(_list);
screen.invalidate();
}
});
}
}
public void drawListRow(ListField list, Graphics g, int index, int y, int w) {
bit = (Bitmap) image.elementAt(index);
g.drawBitmap(xText, y + yText, 80, 200, bit, 0, 0);
}but is not working ?
06-08-2012 08:10 AM