Is it possible to "share"/upload an image ?

  • Hello all,

    I'm looking for a moment how to share an image by the Multiplayer function. I found some tutorials, but it's not really what I want.

    In fact, I would like the person to be able to choose an image, and to be able to exchange it through the Multiplayer plugin by sending

    the code of the image, for example, and to be re-transformed as an image.

    I think that's a bit impossible ...

    I also thought to send an image on an FTP, and to load it with the action "Load image by URL"

    Could you help me ? That would be of great use to me.

    Thanks in advance and good evening,

    Jules

    PS : Please forgive my English because I am French

  • The best you can probably do is use the system canvas snapshot action to get an image as a string.

    Nwjs to load from local folder, multiplayer to send string as message, and browser to invoke download

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The best you can probably do is use the system canvas snapshot action to get an image as a string.

    Nwjs to load from local folder, multiplayer to send string as message, and browser to invoke download

    Hello,

    I do not quite understand, could you explain more precisely ? (I'm a beginner)

    Thank you in advance

  • Julot135

    Do you have limitations on the platform and plugins you can use?

    I have an app in NWJS for PC desktop which I can open photos and save (Invoice generator).

    Using NWJS and Paster objects you can give the user an open dialogue, load in a picture and save the picture as a string in base64 format. (Very long text).

    I am guessing this could then be sent across multiplayer to another user. I am afraid I've not done anything with the multiplayer plugin yet so I would nowt know about this part. (I only made a multiplayer game about 4 years ago with PeerJS)

  • Julot135

    Do you have limitations on the platform and plugins you can use?

    I have an app in NWJS for PC desktop which I can open photos and save (Invoice generator).

    Using NWJS and Paster objects you can give the user an open dialogue, load in a picture and save the picture as a string in base64 format. (Very long text).

    I am guessing this could then be sent across multiplayer to another user. I am afraid I've not done anything with the multiplayer plugin yet so I would nowt know about this part. (I only made a multiplayer game about 4 years ago with PeerJS)

    Mayfly

    Hello,

    No, I don't have limitations. But It could be very cool if it's compatible with IOS and Android.

    Can you send me your application ?

    Thanks you in advance,

    Jules

  • Hi Julot135

    I am afraid i can't send my application due to some sensitive info in it. I've been trying to modify the multiplayer template to send pictures using NWJS and Canvas but it crashes each time <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad"> It seems the base 64 string is too long to send and causes the app to crash.

    https://1drv.ms/u/s!Am9ctVZP5a3jiJE6LjvmPWm1RRBBiQ

    You can get what I have tried so far in the link above. I'll have a further play around on it later today.

  • Hi Julot135

    I am afraid i can't send my application due to some sensitive info in it. I've been trying to modify the multiplayer template to send pictures using NWJS and Canvas but it crashes each time <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad"> It seems the base 64 string is too long to send and causes the app to crash.

    https://1drv.ms/u/s!Am9ctVZP5a3jiJE6LjvmPWm1RRBBiQ

    You can get what I have tried so far in the link above. I'll have a further play around on it later today.

    Hi Mayfly,

    Thanks you for your application. It's a good idea. For me the application don't crash but get disconnected from the host, and if it's the host sending the image all players will be disconnected <img src="{SMILIES_PATH}/icon_e_confused.gif" alt=":?" title="Confused">

    Do you have an idea to correct this bug ?

    And for your application containing sensitive data, does it work?

    If it work, it would be really nice to explain me how or to send me just the base, the principle of sending.

    Thanks you in advance and good evening,

    Jules

  • Hi Julot135

    I did not have any lukc fixing the disconnect. I am guessing its because it is so long. I could not find a way to shorten the string either

    My application does not send a picture over the internet. It just allows a picture to be loaded into a quote and then the base64 saved as a string so that the 'save' feature in C2 keeps the variable to allow it to be reloaded.

    I guess the other way to do this would be to store the picture being sent online?

    So if you send the picture you actually talk to online and upload it. It then tells the other person to download from this location etc...

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