Reputation: 3480
Is there any problem with using a same bitmap for different picture boxes or is it better to create a new bitmap for each picture box from the same stream?
picbox1.Image = new Bitmap(myStream);
picbox2.Image = new Bitmap(myStream);
picbox3.Image = new Bitmap(myStream);
or
var myBitmap = new Bitmap(myStream)
picbox1.Image = myBitmap;
picbox2.Image = myBitmap;
picbox3.Image = myBitmap;
Thanks
Upvotes: 0
Views: 63
Reputation: 128
If you are to use the exact same bitmap in each picturebox, I think it's best to use the same bitmap object as well. That seems to be the most efficient way to do it.
Upvotes: 5