Aurigma Forums
»
Graphics Mill
»
Discussions – Graphics Mill
»
Error The specified pixel format is not supported. using GifWriter
Rank: Newbie
Groups: Guest
Joined: 6/23/2020(UTC) Posts: 5
Thanks: 1 times
|
I get the error "The specified pixel format is not supported." on the line: Pipeline.Run(reader + writer); using (var writer = new GifWriter(gifFlyerPath)) { writer.FrameOptions.Delay = 200; for (int i = 0; i < pngFiles.Count; i++) { using (var reader = ImageReader.Create(pngFiles[i])) { Pipeline.Run(reader + writer); } } } The png files are created in WPF by rendering a Visual using: RenderTargetBitmap bmr = new RenderTargetBitmap( (int) adjustedWidth , (int) adjustedHeight , resolut , resolut , PixelFormats.Pbgra32); bmr.Render(ThisDocument.Canvas_Base); Bitmap bm = null; using (MemoryStream stream = new MemoryStream()) { BitmapEncoder encoder = new PngBitmapEncoder(); encoder.Frames.Add(BitmapFrame.Create(bmr)); encoder.Save(stream); bm = new Bitmap(stream); var parms = new EncoderParameters(1); parms.Param[0] = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 100L); string thisSlidePath = slidePath + sNo + ".png"; bm.Save(thisSlidePath , GetEncoder(ImageFormat.Png), parms); pngFiles.Add(thisSlidePath); sNo++; }
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 9/19/2006(UTC) Posts: 505
Was thanked: 41 time(s) in 41 post(s)
|
Hello Mark, GifWriter expects Indexed pixel format as an input. I guess BmpBitmapEncoder saves images in plain RGB format. You can try to use the ColorConverter class to convert the image to Indexed format. Here is a small sample. Best regards, Eugene |
Best regards, Eugene Kosmin The Aurigma Development Team
|
|
|
|
Rank: Newbie
Groups: Guest
Joined: 6/23/2020(UTC) Posts: 5
Thanks: 1 times
|
The sample you referenced gave me a solution. Thank you.
|
|
|
|
Aurigma Forums
»
Graphics Mill
»
Discussions – Graphics Mill
»
Error The specified pixel format is not supported. using GifWriter
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.