Newbie question (and more adv)

  • Thread starter Thread starter Ivan Demkovitch
  • Start date Start date
I

Ivan Demkovitch

Hi!

Here is code I have:

byte[] a;
a[1] = 3;
//Here I get syntax error (something about brackets. Parameter expect byte
array. What is correct syntax ?)
Response.OutputStream.Write(a[], 0, 1);

Some other simple questions:

1. How do I load jpeg from file and resize it?

2. How do I save it then into byte array ?

Any pointers/samples appreciated.

TIA
 
Hi!

Here is code I have:

byte[] a;
a[1] = 3;
//Here I get syntax error (something about brackets. Parameter expect byte
array. What is correct syntax ?)
Response.OutputStream.Write(a[], 0, 1);

Some other simple questions:

1. How do I load jpeg from file and resize it?

2. How do I save it then into byte array ?

Any pointers/samples appreciated.

TIA
Hi Ivan,
before you can assign a[1], you have to make an instance:

byte[] a;
a = new byte[10];
a[0] = 1;


1. Loading image from file:

System.Drawing.Bitmap oPic = new System.Drawing.Bitmap("mypic.jpg");

2. Saving: Bitmap class has Save method which saves the image to stream.
Read about MemoryStream class.

Hope this helps
Sunny
 
Thanks,

I got it working.

Sunny said:
Hi!

Here is code I have:

byte[] a;
a[1] = 3;
//Here I get syntax error (something about brackets. Parameter expect byte
array. What is correct syntax ?)
Response.OutputStream.Write(a[], 0, 1);

Some other simple questions:

1. How do I load jpeg from file and resize it?

2. How do I save it then into byte array ?

Any pointers/samples appreciated.

TIA
Hi Ivan,
before you can assign a[1], you have to make an instance:

byte[] a;
a = new byte[10];
a[0] = 1;


1. Loading image from file:

System.Drawing.Bitmap oPic = new System.Drawing.Bitmap("mypic.jpg");

2. Saving: Bitmap class has Save method which saves the image to stream.
Read about MemoryStream class.

Hope this helps
Sunny
 
Back
Top