[Pas2js] pas2js array of UInt8ClampedArray constants

Michael Van Canneyt michael at freepascal.org
Wed Oct 6 08:55:47 CEST 2021



On Tue, 5 Oct 2021, nick's hardware wrote:

> Is there a pas2js way of doing what this javascript code does?
>
> var Image  = new Uint8ClampedArray([0,0,0,255,0,0,0,255,0,0]);

This works:

var
   a : TByteDynArray;
   Image : TJSUint8ClampedArray;
begin
   a:=[0,0,0,255,0,0,0,255,0,0];
   Image:=TJSUint8ClampedArray.From(a);
end;

Michael.


More information about the Pas2js mailing list