How do I open and capture images of any size?

0 favourites
  • 3 posts
From the Asset Store
A versatile and wide-ranging selection of large to medium-sized creature sounds.
  • The more I think about this the more I'm worried that it won't be doable... Would love to get some feedback!

    Here's what I am planning:

    1. My app will run online

    2. Users can upload any size .png or .tiff image

    3. The image will scale to fit whatever screen they are using

    4. Users can type in a message and move it around the image

    5. Users can then re-save their image, WITH the text in the appropriate place

    I seem to recall there being a way in Construct 3 to capture an image from the screen. But, what if the user uploaded an image that was significantly larger than their screen? Wouldn't the capture reduce the quality of the image? (Since the image had to be scaled down.)

  • I think this should work. We would be using the DrawingCanvas Plugin for taking the screenshot.

    1.

    While scaling to fit in screen, you will keep the image ratio same right?

    So, to keep the ratio same, you would have to divide both height and width by the same number. For this, let's say we create a global variable called Scale.

    And we have a SizeLimit into which the image would have to fit in.

    To get the value of Scale, divide SizeLimit by the larger one out of the width and height of the Original Image.

    2.

    In this scaled image, the player would be able to place text and all.

    Before taking a screenshot, the image has to be resized back to its original scale, that is 1.

    But the text remains in its small form and its position remains unchanged, and now doesn't match with what the player intended.

    To sync the text size and position with the original size of the image, we need to multiply the current text size and position with inverse of the Scale variable value we got earlier.

    That is, multiply it's size and position with 1/Scale

    3.

    Then position and set size of the DrawingCanvas Plugin to that of the Sprite. And now take the screenshot.

    I made a small example. This might help.

    https://drive.google.com/file/d/1x3HOfMwJXuubxXrNQ2azqnvK5GyinX2I/view?usp=drive_link

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'll take a look at this. Thank you for taking the time!!

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