this will be a noob question.
I’m new to c#
I have a file upload server control that I am using to save images to server.
I have, in my library, an image resize function with this parameter:
byte[] resizeImage(byte[] image, int witdh)
that i am supposed to use.
now, i am saving my file to some path as upImage.saveas(“filepath”);
ok?
now, I want to resize this image and i cant figure how to convert that image to bytes???
where is the article to convert? everywhere i see, i can only see bytes to image but i want other way around..
please help?
Do you mean convert the saved file to a
byte[]array? If so, you can useFile.ReadAllBytes:If you want to grab the
byte[]array directly from yourFileUploadcontrol then you can use theFileBytesproperty: