On my Mac, when I create a Picture in XOJO and put it on the clipboard, and then paste it into a email, it ends up in the email as a tiff.
For example:
Dim p as picture
p = CreateSomePicture()
Dim c as New Clipboard
c.Picture = p
Then Paste this picture into the body of an email message, it will be a tiff.
How do I get it to be a jpeg in the email.
If I open a jpeg picture file in Preview, Select All, Copy, then Paste this into an email, it will be a jpeg in the email.
Of course, I could save the Xojo picture as a jpeg file then do the above view,select all, copy, but this is cumbersome
Does anyone know how to do this?
I think this might have something to do with the native format of the macOS pasteboard… Not knowing how the .Picture method saves the image to the pasteboard… I do not know if converting the picture to a JPEG MemoryBlock and then out to a string, to use .AddRawData, with the UTI image.jpeg would work…
First of all, please check what you have in yout clipboard.
To do that, go to the AppleScript Editor application (don’t know the US name) and copy/paste the script below:
return clipboard info
Then run the code and watch what you will find in the Results area (window bottom). As a test, I used cmd-shift-4, select a part of the screen to be copied in the Clipboard and run the script/ I get:
At Paste time, either (or both or ) the OS / the Application will choose the appropriate contents to paste. The mechanism is the same one that does not allw you to paste a text in Preview as graphics document -{ or Paste an image in TextEdit in the raw (not RTF /RTFD) format.
So, telling you get tiff and can be wrong.
That said, I do not know how to convert an image to the JPEG format (and since this is a lossy format, I do not want to do that).