How do I capture the entire canvas

Get help using Construct 2

Post » Sun Jul 19, 2015 12:40 am

The manual says that canvas snapshot only captures the current display into an image string. Is there any way to capture the whole canvas as an image string? I wish to draw a canvas image and regardless of the viewport size, save the canvas as a whole to either a printable image file or pdf file. Or am I not reading it right regarding the canvas snapshot?

Snapshot canvas
Take a screenshot of the current display. This triggers On canvas snapshot when the snapshot is ready, and the resulting image can be accessed with the CanvasSnapshot system expression. This can then be loaded in to a sprite or tiled background, sent to a server, or opened with the Browser object in a new tab.
www.h1k3.tech

We are here for you!
B
87
S
22
G
16
Posts: 715
Reputation: 16,785

Post » Sun Jul 19, 2015 2:52 am

I'm not too sure if there is an 'official'/ correct solution to this, but a workaround that could work (though I'm not sure if it would be hugely effective) would be to momentarily change the view to encompass the entire layout for the moment before the snapshot is taken, before returning to the regular view. That way even if the snapshot is purely the current view, it would be a view of the entire canvas.

If you did it within a small space of time, chances are the user wouldn't even notice.

I hope this helps somehow! :)

Regards,
Gideon
B
10
S
1
Posts: 72
Reputation: 1,015

Post » Sun Jul 19, 2015 3:01 am

@GideonG thanks but that didn't really help. I want to be able to save the entire canvas so I can later email it and print it out. Expanding the canvas might lose something during printing due to the pixels suddenly becoming so small. Thank you though it will probably help someone. :)
www.h1k3.tech

We are here for you!
B
87
S
22
G
16
Posts: 715
Reputation: 16,785

Post » Sun Jul 19, 2015 3:36 am

How big is the layout / would capturing it on an image a max 2048x work 1:1 for example, or will you have to accept losing some resolution to cover the width/height of the laout?

No matter, I would suggest trying to use either the Canvas plugin (which lets you paste layers) or the Paster plugin (to which you can paste families and it's faster than Canvas). You can download either as an imageURL using the Browser invoke download action. I couldn't get Canvas to work with umbra just now (don't know why), so Paster seems like a better option IMO, even if you'll need to code a few lines of object pasting to get the image you're after.
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,205
Reputation: 43,832

Post » Sun Jul 19, 2015 6:46 am

@lanceal Yeah, I thought that may be the case. Figured it was worth a suggestion in case it worked. As Colludium says, you may need to look into 3rd party plugins and such. All the best in trying to solve your problem! :)
B
10
S
1
Posts: 72
Reputation: 1,015

Post » Tue Jul 28, 2015 6:59 pm

my problem is save the screenshot at smartphones... work nice on web , but I can´t do this work at my android. Any tip?
B
34
S
6
G
3
Posts: 67
Reputation: 3,618

Post » Wed Jul 29, 2015 2:09 am

Why yes @Alemar I'm using a combination of plugins to accomplish my goal. I use the canvas plugin to capture an entire layer and paste it to a sprite. Then I use paster plugin to save the data from the sprite and use it however I wish.
www.h1k3.tech

We are here for you!
B
87
S
22
G
16
Posts: 715
Reputation: 16,785

Post » Tue Aug 04, 2015 4:08 am

thank you lanceal I´ll try paster plugin. Right now I´m triyng to use cranberry screencapture cordova plugin , but no luck...
B
34
S
6
G
3
Posts: 67
Reputation: 3,618


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests