How share an image to the group highlighted in red only withot save image?

I don’t want to save the image, but I want to share an image to the group highlighted in red only when I press the Share Image button. How do I do that?

Untitled-1

можно точнее ?
Can you be more precise?

1 Like

When you click button”share image” take a picture “screenshoot” of what is inside the red frame in the “group with its contents” will be taken and shared with any mobile mediator.
Without saving on the device storage, just share the image with another example:
screenshoot for group
tt

Я попробовал несколько способов, но все не удачно.
На сколько я понимаю изображение должно существовать, тогда программа может работать с ним.
I tried several methods, but all were unsuccessful.
As far as I understand, the image must exist, then the program can work with it.
Вот пример:

import QtQuick 2.15

Item{
    property string fileName
    
    Connections {
        target: document.childByName("Button 1").scriptAdaptor
        onEventItemPressed: {
            var date = new Date();
            var year = date.getFullYear();
            var month = ("0" + (date.getMonth() + 1)).slice(-2);
            var day = ("0" + date.getDate()).slice(-2);
            var hours = ("0" + date.getHours()).slice(-2);
            var minutes = ("0" + date.getMinutes()).slice(-2);
            var seconds = ("0" + date.getSeconds()).slice(-2);
            fileName = "file_" + year + month + day + "_" + hours + minutes + seconds;
            document.childByName("Page 1").scriptAdaptor.actionSaveAsImage(fileName)
        }
    }
    Connections {
        target: document.scriptAdaptor
        onEventFileSaved: {
            document.childByName("Image 1").content.scriptAdaptor.actionAddImage(document.documentsPath+"/"+fileName+".png")
        }
    }
}

empty_27.flp (723.6 KB)

1 Like

Thank you very much mr Vladimir_PV
I tried this method but:
1- If the application is Android 13, I must allow writing and reading permissions on the device’s storage to allow saving in the phone’s storage. What is the code for that?
2- The method is cumulative saving, where when you press the button, you save image 1, then pressing it again, you save image 2…and so on every time you press the button.
And I want it to save the new image in place of the old one when I press it. This means that only one image is left when I press the button and then open it on the mobile application after saving to share it.
3- After saving, the image opens in the gallery or any application so that I can share it

  1. Я не с таким не сталкивался, я не знаю как это решить кодом
  2. просто создайте статическое имя.
import QtQuick 2.15

Item{
    property string fileName: "MyFileName"
    
    Connections {
        target: document.childByName("Button 1").scriptAdaptor
        onEventItemPressed: {
            document.childByName("Page 1").scriptAdaptor.actionSaveAsImage(fileName)
        }
    }
    Connections {
        target: document.scriptAdaptor
        onEventFileSaved: {
            document.childByName("Image 1").content.scriptAdaptor.actionAddImage(document.documentsPath+"/"+fileName+".png")
        }
    }
}
  1. Я с такой задачей еще не сталкивался, скорее всего для этого нужно использовать функцию (share file). Нужно передать файл в конечную программу. То есть. Тут видимо использовать API в android.

  2. I have never encountered such a problem, I do not know how to solve it with code

  3. just create a static name.

import QtQuick 2.15

Item{
    property string fileName: "MyFileName"
    
    Connections {
        target: document.childByName("Button 1").scriptAdaptor
        onEventItemPressed: {
            document.childByName("Page 1").scriptAdaptor.actionSaveAsImage(fileName)
        }
    }
    Connections {
        target: document.scriptAdaptor
        onEventFileSaved: {
            document.childByName("Image 1").content.scriptAdaptor.actionAddImage(document.documentsPath+"/"+fileName+".png")
        }
    }
}
  1. I have not encountered such a task yet, most likely for this you need to use the function (share file). You need to pass the file to the final program. That is. Here, apparently, use the API in android.
1 Like

Thank you for your effort mr Vladimir_PV
I hope to find a solution to the problem because the permissions in Android 13 require a solution with a code or something else in flipabit because they are not supported.
And code also to open the image after saving on gallery.
Thank you and I wish you success


Back to Flipabit >
Copyright © 2018. Flipabit Team. All rights reserved.