thispainting= screen.GetByteArray(0, 0, 5, 5)The code the Roku outputs looks like this:
strx=thispainting.ToBase64String()
? strx
SendPaintingPost(strx)
$data ='q6ur/6urq/+rq6v/q6ur/6urq/+rq6v/q6ur/6urq/+rq6v/q6ur/6urq/+rq6v/q6ur/6urq/+rq6v/q6ur/6urq/+rq6v/q6ur/6urq/+rq6v/q6ur/6urq/+rq6v/q6ur/w==';and the good sample code i have looks like this:
$data = 'iVBORw0KGgoAAAANSUhEUgAAABwAAAASCAMAAAB/2U7WAAAABl' //worksSee how one of these things is not like the other?
. 'BMVEUAAAD///+l2Z/dAAAASUlEQVR4XqWQUQoAIAxC2/0vXZDr'
. 'EX4IJTRkb7lobNUStXsB0jIXIAMSsQnWlsV+wULF4Avk9fLq2r'
. '8a5HSE35Q3eO2XP1A1wQkZSgETvDtKdQAAAABJRU5ErkJggg==';
$data = base64_decode($data);Any ideas would be appreciated. Thanks
$im = imagecreatefromstring($data);
"RokuMarkn" wrote:
Also, even if the server accepted an RGBA bitmap, the server is doing a base64 decode so you would need to do a base64 encode on the Roku before sending it. That's why your data doesn't look like the sample data.
--Mark
strx=thispainting.ToBase64String()doing then? Is it not an encode?
$im = imagecreatefromstring($data);expecting jpeg encoded data? Because you can do either imagejpeg(' ') or imagepng(' ') after this to make a file.
"squirreltown" wrote:
KC - So is this php$im = imagecreatefromstring($data);expecting jpeg encoded data? Because you can do either imagejpeg(' ') or imagepng(' ') after this to make a file.
"RokuMarkn" wrote:
Sorry, I didn't notice the encode. But the $data= line you quoted doesn't look like it was printed on the Roku. That looks like piece of PHP code.Mark
"RokuKC" wrote:
It seems what you really want is a Roku 2D API that gives you PNG or JPEG output, but that is not available.
"RokuKC" wrote:
Is your intent to send a full screen image, at 1280 x 720? Or just a small part of it?
If you are sending a full screen image, without compression it would be pretty big (3.5 MB?).
"squirreltown" wrote:
Either one of you care to make a suggestion on how I might make it work?
"RokuKC" wrote:
Looks like if you had to, on the server you could do $img = imagecreatetruecolor( $w, $h ) to allocate an image buffer,
then walk over all the pixels and set them from the input pixel data using imagesetpixel.
I imagine there may be more efficient approaches though, browsing PHP docs or internet search may provide options.