업데이트 : BitmapData의 Windows Phone 7.1에 대한 대안을 찾아 보았습니다. 문제의 코드를 주석 처리했습니다. 나는 Lockbits에 대해 알고 있으며, 비교할 때 픽셀이 너무 빠르다는 것을 알고있다. 필자의 이해에 따라 BitmapData는 이미지를 조작 할 수 있도록 메모리에 잠급니다. BmpData.Scan0은 메모리에 대한 포인터 역할을합니다.BitmapData 및 Marshal.Copy? Windows phone의 대안은 무엇입니까?
BitmapData없이이 작업을 수행하려면 Get.Pixel이라고 말하고 메모리에 매핑하십시오. Set.Pixel을 사용하여 일부 이미지 데이터를 조작 할 수 있습니까?
P.S : 처리 속도와 관련하여; 픽셀을 많이 바꿀 생각이 아닙니다.
public int Edit(Bitmap BmpIn, byte[] BIn, byte BitsPerByte)
{
int LengthBytes = 1 + 31/BitsPerByte;
int TextLength = 1 + (8 * BIn.Length - 1)/BitsPerByte;
//BitmapData BmpData = BmpIn.LockBits(new Rectangle(0, 0, BmpIn.Width, BmpIn.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
RGB = new byte[2 + LengthBytes + TextLength];
//Marshal.Copy(BmpData.Scan0, RGB, 0, RGB.Length);
InsertBitsPerByte(BitsPerByte);
SetMasks(BitsPerByte);
InsertLength(LengthBytes, TextLength, BitsPerByte);
InsertBytes(BIn, BitsPerByte);
//Marshal.Copy(RGB, 0, BmpData.Scan0, RGB.Length);
BmpIn.UnlockBits(BmpData);
return TextLength;
}
도움을 주시면 감사하겠습니다. 감사합니다.
이미지를 복제하고 이미지를 조작하는 것이 무엇을 하려는지 명확하지 않은가요? 양자 모두? –
예 이미지를 복제 한 다음 조작하려고합니다. 조금 더 명확하게 밝히면 더 많은 코드를 소개합니다. – user970355