Setup files and embedded pictures / images

  • Developers
  • Setup files and embedded pictures / images
Helmut O'Brian

Posted on 10.05.2017 16:10

Hi everybody,

I'm still working on my automated setup files generator, now I am automatically creating some displays and I am facing an issue.

I tried to automatically add an image to the display.

The XML syntax is like this :

<ImageEx dt="bin.base64" content="bin"> ... </ImageEx>

I thought it would be easy, just encode the file in Base64 and I'd be done. But no ! It seems like you are not encoding only the image, I can't decode any base64 created by DEWESoft and my pictures encoded by me won't be displayed.

So, is there some secret algorithm out there ? What is the expected format and data I must encode to make my images being displayed ?

Thanks for your concern,

Regards,

Maxime

Helmut O'Brian

Posted on 11.05.2017 17:59

No idea ?

Helmut O'Brian

Posted on 12.05.2017 11:41

Super secret stuff ? Is it just raw pixels encoded in base64 ? Can you just tell me wich .NET function / M$ you use ?

DEWESoft Support
Technical support
Posted on 12.05.2017 15:13

Hi,

it's not that it's super secret stuff (at least I'm not aware that it is), it's just that the developer who handles this part hasn't had a chance to look at your question yet. I'm sure we'll have an answer for you next week.

Helmut O'Brian

Posted on 15.05.2017 21:10

OK thanks, I will wait :)

DEWESoft Support
Technical support
Posted on 22.05.2017 11:13

Hi,

it took a bit longer than expected, but here's some feedback from our visual control developer:

"Since the image control is written in Delphi, it uses an internal function for writing TPicture to stream (I've attached a code snippet).

In short, it writes "1 byte" which tells length of LClassName. This means that you need to read the first byte and then skip next number of bytes which will tell class name of the graphics object. I did not check, but it will probably be written something like "TBitmap" as class name.. Rest of the data will be BMP image which you can extract."


Attached files:
Helmut O'Brian

Posted on 29.05.2017 09:39

Hi,

Thanks a lot for your answer ! I will have a look at it in the next days.

Regards,

Helmut O'Brian

Posted on 31.05.2017 08:46

Hello Slovenia,

I looked a bit at the code you sent, can you tell me what is the exact type of the element "Graphic" ? Is it TGraphic ?

Do you use TImage to display the picture or TPaintBox ?

Thanks a lot if you can help.

Regards,

Sašo Piskar
Lead Software Engineer
Posted on 31.05.2017 13:12

Hello Helmut,

we draw directly on window so we don't use TImage or TPaintbox.

Since TGraphic is abstract class (http://docs.embarcadero.com/products/rad_studio/de...) we of course don't use it directly. Exact "Graphic" class is not known, because TPicture (http://docs.embarcadero.com/products/rad_studio/de...) is used as container. This means that TGraphic can be of any class type that TPicture supports.

Clint Mansfield

Posted on 01.06.2017 20:14

I am having the same issue with encoding and decoding the base64. I am trying to make sense of what is happening. Could you guys give a more detailed example ?

Helmut O'Brian

Posted on 02.06.2017 09:48

It looks like the picture class is serialized / flattened in a string a then encoded in base64. It is almost impossible to create it from scratch with another programming language, the only way would be to create some DLL from Delphi which uses the TPicture class.

Unless you have an idea I didn't think about ?



Clint Mansfield

Posted on 07.06.2017 21:58

I have been manually adding images to a setup file, then extract the base64 from that. It works, but is not nearly as automated as I would like. Using the Delphi class does seem like the only way. I have gone in circles trying to encode/decode it otherwise. Will keep checking here for any new information. If i find a way i will post here

Helmut O'Brian

Posted on 07.06.2017 22:04

I am doing the same for now.

Login to reply to this topic. If you don't have account yet, you can signup for free account .