[Pas2js] Picture serialisation into Pascal

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Dec 10 10:13:51 CET 2018


On Sun, 9 Dec 2018 15:00:24 -0700 (MST)
warleyalex via Pas2js <pas2js at lists.freepascal.org> wrote:

>[...]
> III) Signature BeginUpdate / EndUpdate for visual components
> 
> The visual components should be enclosed with a BeginUpdate /
> EndUpdate methods but
> the non visual components which inherits from TComponent shouldn't be
> enclosed.

Wouldn't it be nicer if the user could simply use the Begin/EndUpdate
of the parent (form)? The LCL has this feature.

But I agree, that some possibility to override writing components would
be nice. 

 
> II) when we use a Image component with streams,  for instance, it
> generates a wierd property ExecCustomCSP for the WebImage, which it's
> due a fix up;
> 
>   with WebImage1 do begin
>     Name:='WebImage1';
>     Parent:=Self;
>     Left:=8;
>     Height:=90;
>     Top:=24;
>     Width:=90;
>    
> ExecCustomCSP(Picture,[#4'Data'#10'e'#3#0#0#23'TPortableNetworkGraphicI'#3,

That's because Picture is storing binary data. The default is to use
TWriter/TReader to stream it.
You can use RegisterDefinePropertiesPas to handle TPicture properties
yourself.


> The correct should 
> 
> Picture.Data :=
> 'url("data:image/png;...

Mattias


More information about the Pas2js mailing list