
I am trying to use PNG images that have a transparent background. When I view them on the site (and in the Admin module) the background loses its transparency and becomes black. ZNode tech support verified it is not their imaging DLL causing the problem. There are a number of comments on the Web about this issue in general, but so far no solution I have tried has worked.
Has anyone successfully used transparent PNG images on a ZNode site?
- Rich
Rich, If you specifically
Rich,
If you specifically set the image type to PNG in znodeimage.cs instead of JPG it should work. Try the following:
switch(PhysicalPathToFile.Extension)
{
case ".jpg":
mi.SaveAsFormat = ImageFormat.Jpeg;
break;
case ".jpeg":
mi.SaveAsFormat = ImageFormat.Jpeg;
break;
case ".gif":
mi.SaveAsFormat = ImageFormat.Gif;
break;
case ".png":
mi.SaveAsFormat = ImageFormat.Png;
break;
default:
mi.SaveAsFormat = ImageFormat.Jpeg;
break;
}
Znode Administrator
email: support@znode.com
url: www.znode.com
This Works
I actually implemented something a little different but it didn't work in all cases. I tried the above solution and it works better then mine. Thanks!
Regards,
Rich
PS I am surprised the above code did not made it into a v5.3 or v5.4 release. I can't be the only one using something other than jpg images.