Antwort auf: mobilepickphoto

Startseite Foren Deutsches LiveCode-Forum mobilepickphoto Antwort auf: mobilepickphoto

#2324
Klaus Major
Administrator

    Hi Baumi,

    „answer file xyz“ liefert Dir nur dem Pfa zu einer Datei zurück.
    Dann musst Du damit noch was tun.

    So sollte es klappen:

    on mouseup
       set the lockloc of the templateimage to true
       set the width of the templateimage to 350
       set the height of the templateimage to 200
       set the left of the templateimage to "10"
       set the top of the templateimage to "10"
       if the environment = "mobile" then
          mobilePickPhoto "library"
       else
          
          ## User darf ein JPG oder PNG auswählen:
          answer file "Bitte ein Bild auswählen:" with type "Jpeg,PNG|jpg,png|"
          put it into tFile
          
          ## User hat CANCEL gedrückt
          if tFile = EMPTY then
             exit mouseup
          end if
          
          ## Nun  hast Du zwei Möglichkeiten:
          ## 1. Du IMPORTIERTST das Bild in den Stack:
          import paint from file tFile
          
          ## 2. Du referenzierst das Bild nur:
          # create image
          # set the filename of last img to tFile
       end if
       
       ## Nun hast Du ein Bild auf der aktuellen Karte und kannst mit -> last img 
       ## machen, was Du machen willst...
    end mouseup

    Gruß

    Klaus