Welcome Guest Search | Active Topics | Sign In | Register

TypedArray support Options
ns
Posted: Friday, March 25, 2016 10:22:56 AM
Rank: Member
Groups: Member

Joined: 8/11/2015
Posts: 17
When I try to read a typed array, I can only see a EO.WebBrowser.JSObject.c

How can I access the following array as byte[] ?

Quote:
return new Uint8Array(10);
eo_support
Posted: Friday, March 25, 2016 1:20:10 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

There is no direct efficient way to do that right now. You would use JSObject's interface to access the length property and then get each elements. For example:

Code: C#
//The JSObject.c you see is derived from JSObject
JSObject jsObj = (JSObject)webView.EvalScript("new Uint8Array(10);");

//Get the array length
int length = (int)jsObj["length"];

//Get the first array item value
int firstItemValue = (int)jsObj[0];

Hope this helps.

Thanks!
ns
Posted: Tuesday, April 5, 2016 5:35:38 AM
Rank: Member
Groups: Member

Joined: 8/11/2015
Posts: 17
Is there a plan to provide a way for efficiently copying an array to managed world?
eo_support
Posted: Tuesday, April 5, 2016 8:21:34 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

We will look into it. It does make sense to add this since performance is the whole purpose of the TypedArray object.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.