Page 1 of 1
Export snapshot as jpeg has black border?[SOLVED]
Posted: Wed Aug 19, 2015 4:39 pm
by ClipArtGuy
Hello! Is it possible to use a script like this:
Code: Select all
export snapshot from grp 1 to file (specialfolderpath("Desktop")&"/"MyTestIMG.jpg) as jpeg
WITHOUT the resulting file having a thin black border? If I export as PNG it makes this border transparent, which is OK, but I need my jpgs to not have a border also. I have "showborder" unchecked in property inspector of img 1.... The border appears in Ubuntu 64 bit and windows 7 using stable 7.0.6
Thanks!
Re: Export snapshot as jpeg has black border?
Posted: Wed Aug 19, 2015 4:50 pm
by Klaus
HI ClipArtGuy,
1. welcome to the forum!
2. "export snapshot..." is usually working correctly and not adding anything to the resulting image!
Maybe your group has a tiny border? Sorry, just guessing...
Best
Klaus
Re: Export snapshot as jpeg has black border?
Posted: Wed Aug 19, 2015 5:13 pm
by ClipArtGuy
Hello Klaus,
Thanks for the fast reply!
This recipe produces an image with a border:
Create a new stack
1 - Create a new large rectangle image - uncheck "showborder" and fill with white
2 - Put a small graphic oval over the middle of img 1 (with a height and width much smaller than the first image)
3 - Group them together and run this in message box:
Code: Select all
export snapshot from grp 1 to file (specialfolderpath("Desktop")&"/MyTestImage.jpg") as jpeg
Every time I do this I get exactly what I would expect,but with a black border around the whole saved image that is a few pixels thick.
Can you confirm or deny that this happens for you? I have tested on Ubuntu and Windows with identical results using LiveCode 7.0.6
Thanks again!
Re: Export snapshot as jpeg has black border?
Posted: Wed Aug 19, 2015 5:23 pm
by Klaus
Hi ClipArtGuy,
yes, just tested on my Mac with LC 7.06 and also 6.7.7 and I alspo get this black border.
Great, a NEW bug
Best
Klaus
Re: Export snapshot as jpeg has black border?
Posted: Wed Aug 19, 2015 5:37 pm
by ClipArtGuy
It seems that when the group is created, The group is 2 pixels larger on all sides than the image. I am not sure if this is a bug or a feature....
Re: Export snapshot as jpeg has black border?
Posted: Wed Aug 19, 2015 5:47 pm
by ClipArtGuy
This script is working for me in a button now.
Code: Select all
on mouseUp
set the height of grp 1 to (the width of grp 1 - 4)
set the width of grp 1 to (the width of grp 1 - 4)
set the loc of img 1 to the loc of grp 1
export snapshot from grp 1 to file (specialfolderpath("Desktop")&"/MyTestImage.jpg") as jpeg
end mouseUp
Re: Export snapshot as jpeg has black border?
Posted: Wed Aug 19, 2015 6:15 pm
by FourthWorld
By default new groups have their margins property set to 4. You can change that before creation in the templateGroup, or after creation on the new group.
Re: Export snapshot as jpeg has black border?
Posted: Wed Aug 19, 2015 6:16 pm
by Klaus
Hi ClipArtGuy,
yes, true!
Looks like the MARGINS (Inspector for group -> Text formatting) of the group are causing this!
When set to 0 it works as advertised
Best
Klaus
Re: Export snapshot as jpeg has black border?[SOLVED]
Posted: Thu Aug 20, 2015 12:46 am
by ClipArtGuy
Thank you Klaus and Richard. Marked as solved!