473,387 Members | 3,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Load Image Without Locking File

I want to load a multipage TIFF image into memory as an Image object but I read that the FromFile method locks the file.

Can I load this into a stream, close the physical file then manipulate the image there?
Thanks

Scott
Nov 21 '05 #1
4 8361
Hi,

Open the image with image.fromstream.
Dim fs As New System.IO.FileStream("C:\camera.bmp", IO.FileMode.Open)

Dim img As Image = Image.FromStream(fs)

fs.Close()

PictureBox1.Image = img

Ken

------------------------------
"Scott Meddows" <sc******************@tsged-removeme.com> wrote in message
news:eR**************@TK2MSFTNGP15.phx.gbl...
I want to load a multipage TIFF image into memory as an Image object but I
read that the FromFile method locks the file.

Can I load this into a stream, close the physical file then manipulate the
image there?
Thanks

Scott

Nov 21 '05 #2
Hi,

Open the image with image.fromstream.
Dim fs As New System.IO.FileStream("C:\camera.bmp", IO.FileMode.Open)

Dim img As Image = Image.FromStream(fs)

fs.Close()

PictureBox1.Image = img

Ken

------------------------------
"Scott Meddows" <sc******************@tsged-removeme.com> wrote in message
news:eR**************@TK2MSFTNGP15.phx.gbl...
I want to load a multipage TIFF image into memory as an Image object but I
read that the FromFile method locks the file.

Can I load this into a stream, close the physical file then manipulate the
image there?
Thanks

Scott

Nov 21 '05 #3
But this is in the MSDN documentation.

Remarks
You must keep the stream open for the lifetime of the Image object.

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi,

Open the image with image.fromstream.
Dim fs As New System.IO.FileStream("C:\camera.bmp", IO.FileMode.Open)

Dim img As Image = Image.FromStream(fs)

fs.Close()

PictureBox1.Image = img

Ken

------------------------------
"Scott Meddows" <sc******************@tsged-removeme.com> wrote in message
news:eR**************@TK2MSFTNGP15.phx.gbl...
I want to load a multipage TIFF image into memory as an Image object but I
read that the FromFile method locks the file.

Can I load this into a stream, close the physical file then manipulate the
image there?
Thanks

Scott

Nov 21 '05 #4
But this is in the MSDN documentation.

Remarks
You must keep the stream open for the lifetime of the Image object.

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi,

Open the image with image.fromstream.
Dim fs As New System.IO.FileStream("C:\camera.bmp", IO.FileMode.Open)

Dim img As Image = Image.FromStream(fs)

fs.Close()

PictureBox1.Image = img

Ken

------------------------------
"Scott Meddows" <sc******************@tsged-removeme.com> wrote in message
news:eR**************@TK2MSFTNGP15.phx.gbl...
I want to load a multipage TIFF image into memory as an Image object but I
read that the FromFile method locks the file.

Can I load this into a stream, close the physical file then manipulate the
image there?
Thanks

Scott

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Eric.Jones | last post by:
I've encountered a strange error with loading delimited files from a Samba (SMB) network drive, has anyone else seen this before? (Platform: WinXP Pro, UDB PE 8015, level 02060106, SAMPLE db) ...
3
by: user | last post by:
Hello I finally managed to save Bitmap that reprezented my pictureBox to jpg file, but now how can i load from that file to Bitmap again ? Bitmap does not have any Load or Open method (like...
0
by: Scott Meddows | last post by:
I want to load a multipage TIFF image into memory as an Image object but I read that the FromFile method locks the file. Can I load this into a stream, close the physical file then manipulate the...
1
by: jz | last post by:
Hi All, I have an ActiveX control project, in the main form, I have an image control and load a JPG image from by setting Picture property of Image; I build it and everything is good, I...
4
by: John please don't spam me! | last post by:
VB.Net 2003 Hi, 2 questions: 1. I want to read a file in without locking it, as it is Log file. 2. I want to be able to read from the last point it wa read upto. The project is: Search...
6
by: nuhura01 | last post by:
Hi all... My system contains an image which I have saved it at client side. Unfortunately, when users want to view the image, the image doesn't loaded. If i'm not mistaken, it is set at the HTML...
2
elamberdor
by: elamberdor | last post by:
Hi All! Well, i'm modifying a dynamic map, with lat and long datapoints, my problem is it loads in text perfectly onto exact points I specify on the map, ..well now I want to load in...
2
by: Marcolino | last post by:
Hy Guys, I have a problem loading JPG in a Picture Box. I need to load a jpg files into a PB and then unlock the original JPG. I'm using following code: Dim picture1 As PictureBox Dim...
14
by: Steve K. | last post by:
I have a method that I use to get a System.Drawing.Image from a file without keeping a handle on the file open (so I can delete the file). Here is the code: <code> public static Image...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.