c# - 8 bit PictureBox Display Resolution -


i want create 8 bit pixel image. used draw image in picture box.

bitmap b = new bitmap(8,8); graphics g = graphics.fromimage(b); picturebox8bit.image = b; 

so, code supposed create 8 bit pixel image. when output image on picture box, cant see because small. want how make picture box resolution 8 bit, or image size. can see preview in picture box.

but when use code, picturebox show small dot. rather resized 8 bit best view.

thanks.

you need differ between bitmap dimension describing size of bitmap in pixels wide , pixels high, , bitmap resolution describing number of possible colors.

to create 8-bit bitmap first read msdn documentation. there you'll find constructor used in snippet.

var bitmap = new bitmap(w, h, format8bppindexed); 

where w , h width , height of image.

using 8-bit images uses colorpalette making them bit more complicated use.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -