Drag in, then resize?

Thanks - I will take a look

Ok,
I am having serious trouble with this concept.
Mike provided an example project, but it was too advanced for what I needed, and I couldn’t understand it.

Does anyone know of an extremely basic example project, which ONLY resizes an image which is dropped onto a canvas (without the image actually becoming the canvas background picture), and then saves it to the desktop ??

At least then I have something rudimentary to get started with, which I can break down and comprehend.
Most examples are too complex and written advice here in these posts are too hard to mentally picture, if you are more visually minded like I am :frowning:

Hope someone out there in forum land can help me.
This concept is important to my Xojo education, and I really want to fully understand it.

Thanks.

Richard, try this project.

https://www.dropbox.com/s/le0aiw8h6nq9s73/RichardImageDropResize.rbp

THANK YOU SO MUCH TIM!

That is exactly what I needed; A clean, simple example which is both understandable, and a lot less complex (and less code) than I imagined in my head.

I can now spend tomorrow going through each line and work out what is happening, and at the end will have added another string to my developing bow.

Thank you for spending the time to do that for me - I really appreciate it!

On OSX the resized Pictures in Xojo have a poor quality, so I use sips (with Applescript)

from Tim’s example

with sips

There was a recent thread on how to adjust the quality in Xojo.

Yes, but why use a lot of code if a single line is enough in applescript or in a shell

do shell script "sips -s format png -Z 256 " & inputfile & " --out ~/Desktop/MyIcon.iconset/icon_256x256.png"

Because not everybody is on a Mac?

Axel, thank you for the heads up.
If only I could understand each part of that code - I guess I also need to learn shell scripting :frowning:

THANK YOU :slight_smile:

I thought all that was needed was to change this:

newpic.save(f, picture.SaveAsJPEG)

To this:

newpic.save(f, picture.SaveAsJPEG, 100)

That will help some, but the real problem is with DrawPicture and the method it uses to merge pixels as you shrink the image.

Ok, if I have tried all of these, and none of them work, how do I execute a single line of shell code ???

do shell script "sips -s format png -Z 256 newpic --out ~/Desktop/MyIcon.iconset/icon_256x256.png"
shell script "sips -s format png -Z 256 newpic --out ~/Desktop/MyIcon.iconset/icon_256x256.png"

Dim s As New Shell s.Execute ("sips -s format png -Z 256 newpic --out ~/Desktop/icon_256x256.png")

Dim s As New Shell s.Execute "sips -s format png -Z 256 newpic --out ~/Desktop/icon_256x256.png"

Dim s As New Shell s.Execute sips -s format png -Z 256 newpic --out ~/Desktop/icon_256x256.png

Dim s As New Shell s.Execute (sips -s format png -Z 256 newpic --out ~/Desktop/icon_256x256.png)

Dim s As New Shell s.mode = 0 s.Execute ("sips -s format png -Z 256 newpic --out ~/Desktop/icon_256x256.png")

Dim s As New Shell s.mode = 0 s.Execute (sips -s format png -Z 256 "newpic --out ~/Desktop/icon_256x256.png)

Dim s As New Shell s.mode = 0 s.Execute sips -s format png -Z 256 newpic --out ~/Desktop/icon_256x256.png

I really thought the code below would work, but alas - no png file on my desktop :frowning:
The app compiles and runs - but no png created???

Dim s As New Shell s.mode = 0 s.Execute "sips -s format png -Z 256 newpic --out ~/Desktop/icon_256x256.png"

I even tried this - just in case:

Dim s As New Shell s.mode = 0 s.Execute "sips -s format png -Z 256 pic --out ~/Desktop/icon_256x256.png"

Still no png file ??