Page 1 of 1

export modified image without display?

Posted: Sun Dec 30, 2007 6:21 am
by Weasel73
I'm trying to import an image. Have the user pick a color to change the tint of the image. Then export the changed image.

I don't however want the user to see the image.

So far here is what I got:

Code: Select all

    answer files "Select the files you wish to process:"
    put it into TheFilePath
    import paint from file TheFilePath into image "ImageFile" of card id 1028

    answer color with 255,255,255
    put it into Color2Tint1
 

    set the ink of image "ImageFile" to blendDifference  -- I don't know if this isn't the correct one for tinting.  Haven't found that yet.

    wait 10 tick

    export snapshot from rectangle (the rectangle of image "ImageFile") of card id 1028 to file "Thumbnail.png" as PNG
I've tried "export image" and various other formats of "export snapshot", but they just give me the original image without the ink changes. The above code is successful at giving me the modified image and outside of not figuring out the tinting yet. The main problem I'm having is exporting the changed image without the user seeing it. Is what I'm looking for possible in RR?

Posted: Sun Dec 30, 2007 12:10 pm
by Mark
Hi Weasel73,

Export the image itself instead of a snapshot of it.

Why the wait command?

Best,

Mark

Posted: Sun Dec 30, 2007 4:15 pm
by Weasel73
I put the wait in there to test the following:

Code: Select all

export image "ImageFile" to file "Thumbnail.png" as PNG set the filetype to PNGf
When I use the above code the result is the image without the ink changes. The wait didn't help.

Is there another way to do this? Is something wrong with my export image code?

Posted: Sun Dec 30, 2007 11:19 pm
by Mark
Hi Weasel73,

I've given it some thought and I believe that your original approach is the right thing to do.

To hide the process from the user, you can make a new window and move it off-screen, by setting its left to -100, for example. Currently, I don't know a better way.

Best,

Mark

Posted: Mon Dec 31, 2007 12:08 am
by Weasel73
Thanks. That seems to work.