我加载从文件像素到使用此代码的字节的数组: Bitmap bmp = new Bitmap(filename);
var rect = new System.Drawing.Rectangle(0, 0, bmp.Width, bmp.Height);
BitmapData bmpData = bmp.LockBits(rect, ImageLockMode.ReadWrite, PixelF
我想用指定的调色板创建3x1位图。为了测试,我使用了3种颜色:红色,绿色和蓝色。当我运行我的代码时,我所得到的全是红色(这是第一种颜色)。 这是我的代码 public void CreateTestImg()
{
// List to store colors for palette
List<Color> Colors = new List<Color>();
/
到目前为止,我有: using (MemoryStream ms = new MemoryStream(imageData))
{
Bitmap img = (Bitmap)Image.FromStream(ms);
}
然后,我会想象我将能够得到IMG不知何故的BitmapSource?如果这是完全错误的,请随时纠正我。