About bitmap

T

Tanchi

Hi, Could anyone help me with this error.

I received this error "Invalid Parameter" with this code
fragment.

private void GetPicEmp(long IDNo)
{
byte[] b = TCSys.GetPicEmp(IDNo);
if(b.Length > 0)
{
MemoryStream stream = new MemoryStream(b,true);
stream.Write(b, 0, b.Length);
// Create a bitmap from the stream
Bitmap bmp = new Bitmap(stream); <-- THIS IS Where the
ERROR
// Check for scaling and assign the bitmap to the
Picturebox
if( bmp.Width > 224 && bmp.Height > 192)
{
Bitmap bmp1 = new Bitmap(bmp, new Size(224,192));
PicBox.Image = bmp1;
}
else
PicBox.Image = bmp;
// Close the stream
stream.Close(); }
}

Could any one give a suggestion to this problem?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top