How do I CAPTURE IMAGE from layout's full size?

1 favourites
From the Asset Store
220 Food Sprites in 16x16 pixel size. Perfect for items for a retro style game.
  • I don't see any "DrawingCanvas paste object" actions in your code. If you are not pasting anything, the saved image will be blank.

    Sorry about that dop2000 since "Drawing Canvas Object" is new to me, I didn't understand how to paste, now that you mentioned it as an ACTION I just got it! thank you! :)

    But now I'm trying to understand how to work with it because my software is based on layers as you can see where I disable and enable layers, but now that you mentioned that it works using PASTE. I'm afraid it won't work the same?

    1. What if I want to include or exclude whatever on a specific layer to be exported (like it was with the system snapshot)

    How can I do that using the Drawing Canvas Object?

    .

    2. as I mentioned before, the resolution is not the Layer's size which I make sure that the Drawing Canvas is EXACTLY the same resolution size (it's actually covering it 1:1 by snap to grid).

    Why the resolution is weird? (I get same resolution on window and full screen if it helps)

    How do I fix that and capture full layout / canvas object resolution? (3840 x 2160)

    Thanks ahead! :)

  • I don't know why the resolution is wrong. Try to check drawing canvas size in Debug Mode.

    Like I said in previous comment, you should probably paste objects one by one, from lowest on Z-axis to highest. If any object is on invisible layer, skip it.

    .

    If you are using effects or blend modes, this method may produce a wrong image. In this case you don't have any other choice but to make screen snapshots.

  • Debug mode shows the correct resolution I set that covers the layout, but export gets weird resolution.

    I don't really know how to check it or fix it:

    I thought it's related to the project properties so I play around with the different full screen modes, the best for my case is the letterbox scale because no matter what size the window is, I can see the menus stretch with the same ratio while other modes make a mess with the layout.

    I did found out a BAD thing, the resolution changes as I change the window size... my reason for using the drawing canvas object is to export the PNG with full layout resolution no matter what the window size is or full screen... now I'm very confused with the changes due to window sizes.

    Is there some Action I need to use to LOCK the capture size to be 1:1 as the Drawing Canvas Object size?

    I even tried to change the origin of the Drawing Canvas Object to middle and moved it, but I get the same result.

  • I really don't know. I would suggest making a blank project with 3840 x 2160 DrawingCanvas, trying to paste some sample sprite on it, save and download. If the result image size is smaller, log it as a bug.

    Also, try changing project scaling mode and see if it affects exported image size.

  • I really don't know. I would suggest making a blank project with 3840 x 2160 DrawingCanvas, trying to paste some sample sprite on it, save and download. If the result image size is smaller, log it as a bug.

    Also, try changing project scaling mode and see if it affects exported image size.

    Great Advice dop2000 I just made a clean C3 Test file dedicated to this issue.

    I still don't understand why the Exported Resolution is NOT equal to the full Drawing Canvas Object resolution which is exactly the same as the Layout, Both: 3840 x 2160 (4K) as you can see on the file.

    Different Tests I tried on this file:

    1 - I tried the different project's properties fullscreen mode, Letterbox scale is the best for showing everything while window is changed, also none of the modes FIXED the issue, it was always a WEIRD resolution.

    2 - When I have no Background (before I added the Background Layer) the export was always 1920x1080 which is my current display resolution, once I added the Background layer with TiledBackground to cover the full layout 3840x2160 I get a weird resolution on export... strange consider everything is exactly the same resolution? (Drawing Canvas Object, Layout, TileBackground = 3840x2160)

    3 - I also tried to change the origin of the drawing canvas to the Center and I re-position it in the middle of the Layout to cover everything perfect, it didn't change anything on export so I undo that to the default origin Top-Left corner position.

    I didn't add Camera (zoom in/out) or many extra layers like in my official project to keep it as clean as possible to try tracking down the issue and hopefully understand how to fix it.

    THE GOAL:

    No matter what the Window Size or if it's Full Screen, ALWAYS: Export PNG to Layout's Full Resolution!

    HAVE A LOOK:

    File is Attached, if anyone can please explain how to make it work, PLEASE explain or share the new fixed C3 project or a screenshot of the code (easier for noobs like me to follow).

    Drawing Canvas - TEST (c3 project file)

    Thanks ahead for anyone who can help!

  • Actually, this is an expected and documented behavior. Read the first few chapters here:

    construct.net/en/make-games/manuals/construct-3/plugin-reference/drawing-canvas

    DrawingCanvas's snapshot resolution changes with window size, but only after you draw something on the canvas. If you paste objects and then resize the canvas, the snapshot resolution doesn't change. And if you draw even one pixel on the canvas after resizing (to update snapshot resolution), everything else on the canvas is cleared, so all your pasted objects are lost..

    In conclusion - it's a giant PITA to get the correct size of exported snapshot!

    You can probably resize the canvas in advance (for the target snapshot resolution), then scale layers with object to fit on this canvas, then paste, then export. But I haven't tried it, it's too much work.

  • Thanks for the explanation dop2000 I read it few times and like many things on the manual I didn't find an example or hint for what I'm trying to do since there is no explanation how to capture 100% layout resolution 1:1 ratio so this is much harder for me to solve by myself.

    I understand that it's not going to be simple compare to the system snapshot feature which is: Click = Capture, DONE! but limited to "what you see is what you get" only.

    IDEA:

    I know I should try it first, but based on your explanation which is much more specific to what I try to do and it's great! I had another "logical" idea in my head, it may sound stupid but I wonder what do you think about it and if it's even possible to do in C3.

    WHAT IF:

    1 - I'll create a NEW dedicated EMPTY layout with 3840 x 2160 resolution.

    2 - The Drawing Canvas Object will cover the all layout (same resolution).

    3 - If this option is possible: PASTE the current layout to the other NEW EMPTY Layout?

    4 - When file is created, back to the first layout (where I create and edit my objects).

    Again, I didn't test it because as many other things it's nice "on the paper" but I have no idea how to accomplish this on C3 since it's much more complicated and confusing.

    So I'm just wondering about your opinion, do you think this is a good idea or not even worst trying?

    Any other solutions for this tricky solution are most welcome!

    Please share a working code or visual screenshot that shows how to capture full layout resolution (no matter what window size is or if it's on full screen).

    Thanks ahead! :)

  • I don't know what you mean by "paste one layout to another layout" and I doubt it will work.

    Drawing Canvas size is not equal to its snapshot resolution. And the snapshot resolution depends on current window size (not layout size!), pixel density and god knows what else.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I don't know what you mean by "paste one layout to another layout" and I doubt it will work.

    Drawing Canvas size is not equal to its snapshot resolution. And the snapshot resolution depends on current window size (not layout size!), pixel density and god knows what else.

    I mean if the Drawing Canvas Object is not on the same layout that I create my objects, but on a dedicated own layout and when clicking the Export button to PAST all these instances to the Drawing Canvas Object on that other layout, create the PNG file, then go back to the first layout (creating).

    But it doesn't really matter if it's up to the Window size only.

    Is it possible to change the window size before capturing before exporting to get a HUGE window (even if the user have native resolution of 1920x1080 resolution? and bring it back to the original size when finished creating the PNG file?

    or it will make a total mess for the user, windows will move around other places and for users with multiple screens the window will even change position?

    Forgive me, I'm just out of ideas... it seem like it's impossible to do in C3 and I've learn that asking for new features or tools that are needed is pointless since I'll get the same answer anyway: "the dev team is small" they got better things to do than listen to noob users, I get it. and also "this feature is already built-in just do [insert very complicated programmers terms instructions here] to do it, it's easy!" which is not for people like myself who use C3 based on their original motto "for non-programmers" ...

    Anyway thanks for the help, I do appreciate it I'm just sad that I'll have to use the very limited system snapshot and the users will get really weird image resolutions based on their window size or their screen resolution.

  • Update:

    I may found a temporary (still limited but working) solution, so I thought why not sharing.

    If I limit or should I say FORCE my users to use Full Screen (no window) when using my software, the Drawing Canvas Object allow me to export the full size of the layout!

    For example in my current test, My Display Properties (native screen resolution) is 1920x1080

    But still I managed to export the FULL 4K 3840x2160 resolution of the full layout!

    There are some issues I have with enable/disable after cleaning the canvas but for now it works.

    It is not the best solution but I played so much with it consider I'm a noob and I could force the resolution I want to export to the PNG. so it's kind of nice but still not how I wanted it to work by forcing my users to use ONLY full screen.

  • Try changing Windows resolution and you might find that the snapshot file resolution also changes. My guess is that it will be 3840x2160 px only for some users (who happen to have the same screen resolution as yours).

  • My setup is pretty much mid-low like most people with Full-HD (for each display) but I would love to make it work for lower resolution (old machines) if possible for PC, Mac, Linux users as well.

    I found it very unstable, after exporting few times and keep tweaking (dragging and stuff) when trying to SAVE file (nothing to do with the export) it's either crashes or stuck... so I'm starting to think maybe it will be best to give up on the Drawing Canvas Object even if I'll limit it to 1920x1080, I'm afraid I'll only have issues with the way it renders, Also I think it will require GPU from users but I'm not sure.

    Unlike the example I put here earlier, my software uses 1920x1080 as the display / camera that pan around, zoom in and out, but it can render the all layout (for now) as 3840x2160 which is what I wanted, that way I give my users more space around... but it's not stable and crashes so maybe it's not the best solution after all.

    All I know is that it's not stable at the moment, even on my minimal test projects and I can't blame my hardware since my current machine is is mid-low / average :

    CPU: Intel i7 | 32GB RAM | GPU: GeForce 980 4GB | HD: SSD | OS: Windows 10

    Once I'll get to finish most of the features on my software, obviously I'll test it on lower machines and other OS.

    For now, if something is not working well on my machine or make things slow/stuck... it's a warning for me to try something else to keep the software as light as possible.

    Maybe I'm wasting my time on this but at least it's a good practice for learning so I'm happy about it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)