V
Vertilka
Hi friends,
I am getting a stream of PixelData (without header) from the network
(other computer).
I am trying to display this pixel data in a picture box with following
code (in "Form_Load"):
byte [] pixeldata = new byte[720*576*3]; // 720 width, 576 height, 3
channels(RGB)
GetPixelDataFromServer(ref pixeldata);
IntPtr ptr = (IntPtr) BitConverter.ToInt32(pixeldata, 0);
Bitmap bmp = new Bitmap (720, 576, 720 * 3, PixelFormat.Format24bppRgb,
ptr);
pictureBox1.Image = bmp;
well, this goes fine (compilation and running) but after that, after i
am out of the method, i get an excption that says:
An unhandled exception of type 'System.NullReferenceException' occurred
in system.windows.forms.dll
Additional information: Object reference not set to an instance of an
object.
and all, the bitmap and the picturebox are valid (not null);
Call stack is:
Thanks,
Vertilka
I am getting a stream of PixelData (without header) from the network
(other computer).
I am trying to display this pixel data in a picture box with following
code (in "Form_Load"):
byte [] pixeldata = new byte[720*576*3]; // 720 width, 576 height, 3
channels(RGB)
GetPixelDataFromServer(ref pixeldata);
IntPtr ptr = (IntPtr) BitConverter.ToInt32(pixeldata, 0);
Bitmap bmp = new Bitmap (720, 576, 720 * 3, PixelFormat.Format24bppRgb,
ptr);
pictureBox1.Image = bmp;
well, this goes fine (compilation and running) but after that, after i
am out of the method, i get an excption that says:
An unhandled exception of type 'System.NullReferenceException' occurred
in system.windows.forms.dll
Additional information: Object reference not set to an instance of an
object.
and all, the bitmap and the picturebox are valid (not null);
Call stack is:
[<Non-user Code>]
Test.NET.exe!Test.NET.Form1.Main() Line 89 C#
Thanks,
Vertilka