It was a intermittent hardware failure and now the issue is resolved.
Cannot get an proper bitmap 1290 x 960 image in c#?
Pregunta
I am trying to get an bitmap of an image 1280 x 960 using c#. Instead of getting a single 1280 x 960 image, I get 3 replicate images 426 X 320 covering the top 1/3 of the 1280 x 960 area while the remainder 2/3 is black.
here is the uploaded image:
here is the code that I am using.
using System.Runtime.InteropServices;
byte[] frame;
//... code
frame = new byte[1280 * 960 * 3];
// code to get the frame
System.Runtime.InteropServices.GCHandle pinnedArray =
GCHandle.Alloc(frame, GCHandleType.Pinned);
IntPtr pointer = pinnedArray.AddrOfPinnedObject();
Bitmap bmp = new Bitmap(width, height, 3 * width,
PixelFormat.Format24bppRgb, pointer);
MemoryStream JPEGStream = new MemoryStream ();
bmp.Save(filepath, System.Drawing.Imaging.ImageFormat.Bmp);
I would like to get a single 1280 x 960 image covering the entire area.
Solución
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow