이미 RGBa값이 들어가있는 RGBBuffer[1920 * 1440] 으로 BitmapSource 혹은 Bitmap 이미지를 얻고자 합니다. 현재 BitmapSource thermalBitmapSource = BitmapSource.Create(1920, 1440, 96, 96, PixelFormats.Bgra32, null, RGBBuffer, 1920/ PixelFormats.Bgra32.BitsPerPixel); 을 하였으나 System.ArgumentException: '값이 예상 범위를 벗어났습니다' 라는 에러가 나오고 있습니다. 위 문에 어떤 점이 잘못된 것인지 혹은 위 방법 말고 다른 방법이 있는지 조언을 구하고 싶습니다..
1.5K
1
1
0
윈비·2022-05-08
// Define parameters used to create the BitmapSource.
PixelFormat pf = PixelFormats.Bgr32;
int width = 200;
int height = 200;
int rawStride = (width * pf.BitsPerPixel + 7) / 8;
byte[] rawImage ...