Convert transparent PNG on import?

Marty Knapp martyknappster at
Tue Feb 3 20:39:36 CET 2015

Thanks Peter. It may be that we're mixing up two different threads here 
- there's another about detecting mouse events inside images. In my app, 
users create documents and are able to import images as part of their 
design. These documents are then printed and a print job could include 
hundred of pages. So I don't want to hide anything that the user would 
expect to have printed.

On Mac I'm not having any trouble. On Windows, if the image has 
transparency either by virtue of its format (ie. a transparent PNG) or 
transparency has been applied by changing its blendLevel (to fade the 
image), then very weird things happen. The image gets cut off, "borders" 
or lines that aren't there get printed and on a long print run the app 
will become unresponsive for some time and it may just stop printing.

I've filed 2 bug reports on this: 14089 and 14256 and they have both 
been confirmed. If anyone is so inclined and are working on a Windows 
machine, they could download the sample stacks and see what's happening. 
My app is built with LC 6.6.5 but the issue seems to span the entire 6.X 
series. On LC 6.7 the bug manifests itself a little differently but it's 
still not working correctly.

As I didn't want to delay the release of my program, not knowing if/when 
this would get fixed, I crippled the Windows version by disallowing the 
import of PNG images as they might have transparency. I also disabled 
the "fade" control. Not a very satisfactory solution. My thought here 
was that if I could allow a non-transparent PNG to import but disallow 
or convert a transparent PNG to non-transparent. That would be a little 

Instructing the user to not use a transparent PNG is not an answer. I 
know someone will do it and then they'll be very unhappy with the results.

Marty K
> On Feb 3, 2015, at 12:28 PM, Marty Knapp wrote:
>> Thank Bernd, I'll give that a try. Detecting mouseClicks or other mouse related functions aren't an issue for me in this case - it's that printing images with transparency on Windows can really come out strange and in some cases cause printing to fail.
> if the platform = "Win32" then
>     hide grc "transparentMask"
> end if
> -- print routines here
> show grc "transparentMask"
> This would take care of it, no?
> -- Peter
> Peter M. Brigham
> pmbrig at

More information about the use-livecode mailing list