c# - Why I got error parameter is not valid while retrieving image to picture box? -
i have written code retrieving image database picturebox. got these error
'parameter not valid'
at line picturebox1.image = image.fromstream(stm);
byte[] imagebyte = new byte[0]; imagebyte = (byte[])(dr["pic_image"]); memorystream stm = new memorystream(imagebyte); picturebox1.sizemode = pictureboxsizemode.stretchimage; picturebox1.image = image.fromstream(stm);
would please solve error?
when provide stream , expects 1 of next files :
bmp
gif
jpeg
png
tiff
make sure file in 1 of these formats
c#
No comments:
Post a Comment