642 views
in GUI Development by

Hi,

 

I tried to implement the extern bitmap image same as the example project but it gives me an error as "Call to an unknown method 'EwLoadExternBitmap()"

I tried to trace out but i could not debug .

https://ask.embedded-wizard.de/?qa=blob&qa_blobid=14294822145430121451

1 Answer

0 votes
by

Hello Pidea,

please see the section: Extern Bitmap and Prototyping and the superior chapter Extern Bitmap Loader. See also the section Example explaining the necessity to implement the interface to an external image loader. Your example does not contain the necessary implementation, therefore you got the error message.

In the simplest case you could try to copy the file ExternBitmapLoader.ewi from the example to your own project directory. It contains a simple implementation of the mentioned interface. In practice you will possibly need to implement your own interface as explained in the documentation referred above.

Best regards

Paul Banach

by

hi ,

I tried implementing as per the documentation 

I have implemented the code in separate file as image.c and include image.h as inline function 

And in specific screen i have added the following code 

 var string file1 = "./Resources/RoundedRectangleBlack.png";
Label2.String = file1;

Image1.Bitmap = ExternBitmap1;
 native {
      printf("native");
      EwLoadExternBitmap(file1 );
  }

Am i  missing any more implementation, i checked the file1 output string it is same which i have send 

https://ask.embedded-wizard.de/?qa=blob&qa_blobid=8330710688574212178

by

Hello Pidea,

what you are trying to do, will not work. Especially the invocation of EwLoadExternBitmap() within native statement does not make sense. Before you continue, it would be helpful when you read once more the following documentation:

Displaying dynamically loaded images

The error message "Call to an unknown method 'EwLoadExternBitmap()" indicates that there is no corresponding functionality available during Prototyping. See the excerpt from the above referred documentation:

The question here: do you want to display dynamically loaded bitmaps in the target system only or also during prototyping?

1. In the first case, the above explained option 1 is sufficient. This should suppress the error message during prototyping.

2. If you want the images to be displayed also during prototyping (in Embedded Wizard Studio), option 2 is true. In this last case, you have to provide the functionality (e.g. image.c file) compiled within an Intrinsic Module.

Creating Intrinsic Modules, however, is a very advance aspect. Thus the question, do you really need the dynamically loaded images during prototyping?

Best regards

Paul Banach

by
Hi paul,

Option1 is applicable for my project. it suppress the error message during prototyping

If i tried to run from win32 based environment i.e from viusal studio ( " unresolved external symbol _EwLoadExternBitmap referenced in function _ResourcesExternBitmap_load").

If i understand correctly than this " EwLoadExternBitmap" method need to be implemented i.e method which i  have written in image.c file ?
by
One more question.

That image get loaded only once after that if i try to upload new images it does not get updated .As i could not see any clear bitmap method but i have tried to reload ().. but still it does not  update the image
by

Hello Pidea,

If i understand correctly than this " EwLoadExternBitmap" method need to be implemented i.e method which i  have written in image.c file ?

Yes, the image.c file contains a C function named EwLoadExternBitmap. When you add the image.c file to the Visual Studio project, the C compiler error message should disappear. The application should then be able to load the images dynamically at the runtime.

That image get loaded only once after that if i try to upload new images it does not get updated .As i could not see any clear bitmap method but i have tried to reload ().. but still it does not  update the image

Well, I don't know what is wrong in this case. The loading is triggered, when the property Name of the Extern Bitmap object is modified or its method Reload() is invoked. See the section Force an Extern Bitmap object to reload its content.

Best regards

Paul Banach

by
I think this is getting me problem ,.

    clr_red = 0;
    clr_green = 0;
    clr_blue = 0;
    clr_alpha = 255;

I have to display png image . So i am not getting what should be the value for this .

I read this articles but still could not figured out .

https://doc.embedded-wizard.de/bitmap-resource-member?v=10.00#1
by
to add more these combination give me

  clr_red = 255;
  clr_green = 0;
  clr_blue = 0;
  clr_alpha = 255; red color

I want directly png image should be displays as per string path . So how should i manged the r,g,b ,a format for the same
by

Hello Pidea,

if you want to display some PNG files, then the image.c implementation is not yet complete. You will need a PNG decoder which is able to read the file, decode it and store the resulting pixel data. Then you can copy the pixel data into the Embedded Wizard bitmap.

Please see the section Using PNG, JPG, BMP, GIF, etc. image decoders. It demonstrates how the function EwLoadExternBitmap() is implemented to use the open source libJPEG library. Similarly, if you want PNG file to be decoded, you will need to integrate some PNG decoder within the EwLoadExternBitmap() function. The necessary PNG decoder you will need to get yourself. Because of license restrictions we are not allowed to distribute such software modules.

Please note: the above explanation is true if the image contents have to be loaded/decoded at the runtime. Besides this Embedded Wizard also supports so-called Bitmap resources. The link from your above comment referred to a section describing such resource. So maybe you are mixing something? Anyway, when using bitmap resources the affected image files are loaded and decoded at the code generation time only. The resulting contents are thereupon fixed.

Thus the question: do you really want the image contents to be loaded dynamically at the runtime? Or is it evtl. sufficient to have the image files built-in within the application created by Embedded Wizard?

Best regards

Paul Banach

by

hi paul,

I have implemented the extern bitmap image 

steps which i have used , may be it will be useful for others.

libpng installed from vcpackage or libpng lib from https://libpng.sourceforge.io/index.html

EwLoadExternBitmap need to be implemented in .c file 

thanks for the help

 

 

by
Hello Pidea,

great to hear that it is working. Thank you for the feedback!

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

...