How do I snapshot as GIF image,better not as base64

Get help using Construct 2

Post » Mon Sep 26, 2016 9:42 am

Is there any way to snapshot stored as gif ?

1.system condition snapshot can save screen shot as base64 png & jpg;but not gif;

2.some browser on android can crash by open base64 image.

any one can help me?

Thank you very much.
B
65
S
13
G
3
Posts: 33
Reputation: 5,429

Post » Tue Sep 27, 2016 4:49 am

Is there a solution?
B
65
S
13
G
3
Posts: 33
Reputation: 5,429

Post » Tue Sep 27, 2016 5:26 am

To save as a gif file you'd need to use some js library that can generate a gif because by default only png/jpg is supported. However it will still be a base64 image.
B
94
S
33
G
118
Posts: 5,394
Reputation: 75,849

Post » Wed Sep 28, 2016 2:14 am

R0J0hound wrote:To save as a gif file you'd need to use some js library that can generate a gif because by default only png/jpg is supported. However it will still be a base64 image.


Thank you R0J0hound.
It is very helpful to me.
Although I also know little about js …… the road is indicated.

As for base64
is there any Curve way to save the country?
B
65
S
13
G
3
Posts: 33
Reputation: 5,429

Post » Wed Sep 28, 2016 5:35 am

How do you get the screenshot as a gif?

The simplest way would be to get a snapshot as a png first, then you can run some JavaScript with either the browser object or your own plugin. You would:
1. Load the base64 into a image. This is done asycronously.
2. When the image is loaded, draw that image to a canvas of the same size.
3. Utilize a JavaScript gif library to take the canvas and spit out a base64 gif.

Skipping to just 3 and using c2's canvas likely won't work when webgl is used. Otherwise notice you cannot get away from base64, so the buggy browsers you allude to will still have an issue. There are probably many gif JavaScript libraries you can find via Google. Any will do, and each is used differently.

However if after taking the screenshot you just want to load it again then converting it to gif first is a needless step.
B
94
S
33
G
118
Posts: 5,394
Reputation: 75,849

Post » Fri Sep 30, 2016 2:17 am

Thank you so much R0J0hound;

I found that the browser witch I wanted to publish the game on it, did not support base64 at all #O_O!
Very antihuman, As long as the base 64 appears, it crashes.(A app called WeChat , the built-in browser,Very difficult to use.)

I have to chang to normal browser, or is there any other way to export pic from C2 game ?
B
65
S
13
G
3
Posts: 33
Reputation: 5,429

Post » Fri Sep 30, 2016 7:20 am

it's hard if the browser doesn't support that. Actually I can't think of any other way of saving a screenshot other than doing the screenshot button shortcut on android.
B
94
S
33
G
118
Posts: 5,394
Reputation: 75,849

Post » Fri Sep 30, 2016 9:47 am

R0J0hound wrote:it's hard if the browser doesn't support that. Actually I can't think of any other way of saving a screenshot other than doing the screenshot button shortcut on android.

:lol: That's right

In fact, I am making an avatar generation tool
Just want to keep the contents of the canvas
Rather than batteries, signals ...
Not necessarily screenshots,
All I need is to output the image…

…GIF is the best
B
65
S
13
G
3
Posts: 33
Reputation: 5,429


Return to How do I....?

Who is online

Users browsing this forum: dop2000, Seruza and 12 guests