This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Several Problems...

stefanmees#837
Hello, i have several Problems with Graphics Mill... here is what i want to do.

I will have a Graphics Konverter "PNG" to "SWF" run in a managed PowerPoint Add-In. Here is the sample code i have used.
using (Aurigma.GraphicsMill.Bitmap bitmap = new Aurigma.GraphicsMill.Bitmap( png ) )
{
  bitmap.Save( swf ,new Aurigma.GraphicsMill.Codecs.SwfEncoderOptions( 75 ) );
}


If i used the Version 3.1 i get a "SynchronizationLockException" (line "new Aurigma.GraphicsMill.Bitmap...." ). In this forum thread (http://www.everythingcyber.com/Forums/Topic510-15-1.aspx) i read about this problem... and you recommend to upgrade to Version 3.5RC (http://www.everythingcyber.com/Forums/Topic3122-16-1.aspx#bm3122). But when i use this Version i get a "UnsupportedPixelFormatException" (line "bitmap.save..."). I attached the png to this thread so you can test it.

Thanks for you suggestions and best from Germany!

Attachments

Dmitry#4310
Hello,

As I understood you try to save image to SWF format with JPEG compression. This compression supports the following pixel formats: 24bppRgb, 32bppArgb, 32bppCmyk, 40bppAcmyk, 8bppGrayscale, 16bppAlphaGrayscale.

Your sample PNG file has 8bppIndexed pixel format, which is not supported by SWF format with JPEG compression. You just need to convert pixel format as it is shown in the following code snippet:
using (Aurigma.GraphicsMill.Bitmap bitmap = new Aurigma.GraphicsMill.Bitmap(@"c:/test.png"))
{  
	bitmap.ColorManagement.Convert(Aurigma.GraphicsMill.PixelFormat.Format24bppRgb);
	bitmap.Save(@"c:/test.swf",new Aurigma.GraphicsMill.Codecs.SwfEncoderOptions(75));
}