08-10-2010 09:00 AM
hi all ,
i need to display an image as logo at the top pf my screen, and below that i should have the
listfield.
i just need to know how to add image .
can anyone help ?
Solved! Go to Solution.
08-10-2010 09:08 AM
EncodedImage company_icon = EncodedImage.getEncodedImageResource("front_logo.p ng");
company_icon = Utility.ScaleImageToSize(company_icon,40,40);
company_logo = new BitmapField(company_icon.getBitmap(), BitmapField.NON_FOCUSABLE);
EncodedImage company_title = EncodedImage.getEncodedImageResource("front_title. png");
company_title = Utility.ScaleImageToSize(company_title,198,40);
company_logoTitle = new BitmapField(company_title.getBitmap(), BitmapField.NON_FOCUSABLE);
Company_icon_HFM = new HorizontalFieldManager()
{
protected void sublayout(int width,int height)
{
layoutChild(company_logo, getPreferredWidth(), getPreferredHeight());
layoutChild(company_logoTitle, getPreferredWidth(), getPreferredHeight());
setPositionChild(company_logo,0,(FieldSize.setY20- 20));
setPositionChild(company_logoTitle,40,(FieldSize.s etY20-20));
super.setExtent(width,FieldSize.setY40);
}
};
Company_icon_HFM.add(company_logo);
Company_icon_HFM.add(company_logoTitle);
Hi,
You can to the above code.
and add above manager.
08-10-2010 09:08 AM
Add the logo.gif image to your project using Import.
then add this line to the Screen before adding other elements.
add(new BitmapField(Bitmap.getBitmapResource("logo.gif")))
08-11-2010 12:54 AM - edited 08-11-2010 12:59 AM
thanks it worked ..