Picturebox中gif的调色板移位? [英] Palette shift for gif in Picturebox?

查看:74
本文介绍了Picturebox中gif的调色板移位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设法为gif创建一个简单的动画类.我使用System.Drawing.Image来保存动画的每一帧,然后将它们显示在图片框中.

我有很多这样的动画,但是我想一次在屏幕上显示其中的几个.不同的颜色,以便人们可以区分开.显然,我不想为每个动画的每个帧都重新着色,所以我想进行一些调色板转换以实现不同的彩色外观.

我一直在尝试同时使用System.Windows. Media.Imaging.ColorConvertedBitmap()和PictureBox.Image.Palette,但是我都没有成功使用.我显然不知道该怎么做.似乎创建调色板的唯一方法是从另一个现有图像中创建调色板?无论如何,我对此都很困惑.

例如,我要做的就是将一个黑色圆圈的gif转换为红色.像这样简单的东西.因此,我使用Image.FromFile(path)加载了图像,然后...我不知所措.

I have managed to create a simple animation class for gifs.  I use a System.Drawing.Image to hold each frame of animation which I then display in a picturebox.

I have a ton of these animations, but I want to display several of them onscreen at once in different colors so people can tell them apart.  Obviously, I don't want to recolor every single frame of every animation, so I want to do some palette shifts to achieve different colored looks.

I've been trying to use both System.Windows.Media.Imaging.ColorConvertedBitmap() and PictureBox.Image.Palette, but I've had no success using either.  I clearly don't understand how to do it.  It seems the only way to create a color palette is to do so from another pre-existing image?  Whatever the case, I'm confused on this one.

All I want to do, for example, is to take a gif of a black circle and shift it to be red.  Something simple like that.  So I load my image using Image.FromFile(path) and then... I'm at a loss.

推荐答案

你好,

感谢您的帖子.我建议将您的问题发布到位于以下位置的论坛或图书馆之一中:

Thank you for the post.  I would suggest posting your question in one of the Forums or Library located here:

http://social.msdn.microsoft.com/Forums/en/windowswic/threads



希望这对您有所帮助.

祝你有美好的一天!


这篇关于Picturebox中gif的调色板移位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆