I need to save the contents of a picture box to a bitmap file. Could someome please write me a little (or big) snippet of code for that purpose? Thanks!
Printable View
I need to save the contents of a picture box to a bitmap file. Could someome please write me a little (or big) snippet of code for that purpose? Thanks!
there is a method called savepicture.
I dont really know the syntax now, but I think it is pretty much like
savepicture picture.image, filename
just look, the function is easy
MisanThr0p, the Image is the default pictureBox properties, hence no need to mention in the code. Like this will do
Code:SavePicture Picture1, "C:\Mypics.bmp"
I heard default properties will no longer exist in newer VB version, so don't even begin programming like that.
It's indeed better to write the whole property.
Else you'll often trap into mistakes which are hard to debug..
If Fox says so :) ;)
However, code runs faster if you don't explicitly state the default property of an object...at least so Im told.
I will test this, but I can't believe it. Maybe, the compile time would be increased 0.000000000001 seconds if you do it all over your code, but I can't imagine, that the program would be slower.
I *think* VB compiles the default property since it doesnt change during runtime, so you will only speed up compiling for 0.000...1 seconds ;)
In other words, it's a matter of preference.