114 views
in Embedded Wizard Studio by
Hi,

I want to know how can I correctly add a external bitmap small image as part of the title of the vertical scrolling list. I am currently using Attributed text and I made one of the bitmap inside attributed as ExternalBitmap

and I read the string path as ExternalBitmap.name ="path", inside setTitle function of vertical list:

SetTitle function looks like this:

 Device.ServiceLogoExternBitmap.Name=Device.Get_LogoServiceList( int16(aIndex) );  // here I am reading a new image for every aIndex and bitmap8 inside attributed text is also  Device.ServiceLogoExternBitmap
 return "{lay90%,*}{col}" +"{img8}" +Device.Get_ServiceList(int16(aIndex));

when i run this i get same image over all the list although for every aIndex a different image is read. I think the last read image is shown with every title text.

P.S. I already have working XBitmap *EwLoadExternBitmap(XString aName) and jpeg and png libraries. I am alrready working on extern images but they are connected to Image and just at a specific location. so they are working fine,

I am missing something while integrating extern bitmap with a vertical list titles, Your help will be highly appreciated!

Thanks in advance

1 Answer

0 votes
by
 
Best answer

Hello MariamSohail,

I suppose, you are using one instance of Extern Bitmap and all items share this one instance. As consequence, there will only be one image at the same time existing. I would propose:

1. For your list implement a separate component acting as item. It means, a component with the appearance of a a single list row. You don't need to use Attributed Text view. In the item you can compose the appearance of the item. For example, you can arrange an Image view and a Text view side by side to display the service logo and the service title.

2. Manage the Extern Bitmap object directly within the list item component (from the step above). In this manner each item manages its own Extern Image instance.

3. When loading the List Item in the OnLoadItem method, initialize the item with the name of the service. At the same time, assign the service name to the property Name of the Extern Bitmap object existing in the item.

I hope it provides the desired functionality.

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...