LoadURL on a TGraphic differs from LoadURL on a TImageControl

This is an issue I detected during the development of a web application. It is not blocking, but may take some time to find out.

A TImageControl loads an image through an URL containing a base64 string. This may be a single line string of a string organized in lines separated by CRLF. A TGraphic can also load image data through loading an URL containing a Base64 string. However, in this case this must be a single string. Loading a Base64 string organized in lines separated by CRLF produces a crash.

A small example illustrates the problem (see picture below): the base64 string from an existing image (1) is used to load another picture (2) and a TGraphic (4). When transforming this single line string into a set of lines separated by CRLF, loading another picture (3) succeeds and loading the TGraphic (5) fails.

Base64

The attached program contains the corresponding code:
Project1.zip (26.3 KB)

Kind regards,

Michel Huybrechts
Micriconsult BV

It is because TGraphic also needs to be compatible with the type of encoding of binary data used in DFM files where linefeeds are treated in a different way.







Bruno Fierens TMS Support
July 23

It is because TGraphic also needs to be compatible with the type of encoding of binary data used in DFM files where linefeeds are treated in a different way.

Dear Sir,

Thank you for this answer. Maybe it would be interesting to mention this in the manual.

Kind regards,

Michel Huybrechts

Micriconsult BV

www.micriconsult.be

We'll discuss how/where to best add it.