Click to See Complete Forum and Search --> : Savina A Bitmap
schnarf283
Dec 20th, 2000, 06:16 PM
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!
/\/\isanThr0p
Dec 21st, 2000, 01:09 AM
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
Chris
Dec 21st, 2000, 08:12 AM
MisanThr0p, the Image is the default pictureBox properties, hence no need to mention in the code. Like this will do
SavePicture Picture1, "C:\Mypics.bmp"
/\/\isanThr0p
Dec 21st, 2000, 12:56 PM
I heard default properties will no longer exist in newer VB version, so don't even begin programming like that.
Fox
Dec 22nd, 2000, 11:56 AM
It's indeed better to write the whole property.
Else you'll often trap into mistakes which are hard to debug..
/\/\isanThr0p
Dec 22nd, 2000, 01:34 PM
If Fox says so :) ;)
seaweed
Dec 22nd, 2000, 02:29 PM
However, code runs faster if you don't explicitly state the default property of an object...at least so Im told.
/\/\isanThr0p
Dec 23rd, 2000, 01:10 PM
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.
Fox
Dec 23rd, 2000, 05:35 PM
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.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.