returning NULL by the function EwLoadExternBitmap() means 'there is no image data to display'. Consequently, all associated Image views are cleared automatically. The difficulty here, the loading operation as well as the update of the associated Image views is performed with some delay. What can you do?
Step 1. Just after loading a new image (or if the loading is failed) the Extern Bitmap object triggers a notification with itself as source of the notification. You can add a new slot method to your component and register it as observer for such notifications. For this purpose use the attachobserver statement as demonstrated below. Usually you perform this registration at the initialization time of the affected GUI component:
attachobserver SlotMethod, ExternBitmapObject;
Step 2: Within the sot method implement code to check whether the Extern Bitmap object has loaded some contents or not. For this purpose evaluate the property FrameSize. If this property is <0,0>, then there is no content. Following could be the implementation of the slot method to check the content of the Extern Bitmap object. Here you can handle the error case, and for example display some default icon:
// No content in the Extern Bitmap object? Then display some default icon in
// the associated Image view
if ( ExternBitmapObject.FrameSize == <0,0> )
ImageView.Bitmap = Application::SomeDefaultIcon;
// Or display the content of the Extern Bitmap object
ImageView.Bitmap = ExternBitmap;
Does it help you?
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!