Question on PictureBox.Image = Image.FromFile(aFile) 
Author Message
 Question on PictureBox.Image = Image.FromFile(aFile)

Hi,
Loading a picturebox from file e.g.
PictureBox.Image = Image.FromFile(aFile) will lock the
source file an make it unoperatinal. How do you unlock
the source file?

Thanks so much

Kelly



Sat, 16 Oct 2004 10:24:48 GMT  
 Question on PictureBox.Image = Image.FromFile(aFile)
Try Something like this....

- Charles

----------------------------------------
Dim fsBLOBFile As New FileStream(strBLOBFilePath, _
FileMode.Open, FileAccess.Read)
Dim bytBLOBData(fsBLOBFile.Length() - 1) As Byte

fsBLOBFile.Read(bytBLOBData, 0, bytBLOBData.Length)
ImageBox.Image.FromStream(fsBLOBFile)
fsBLOBFile.Close()
-----------------------------------------------


Quote:
> Hi,
> Loading a picturebox from file e.g.
> PictureBox.Image = Image.FromFile(aFile) will lock the
> source file an make it unoperatinal. How do you unlock
> the source file?

> Thanks so much

> Kelly



Sat, 16 Oct 2004 16:27:33 GMT  
 Question on PictureBox.Image = Image.FromFile(aFile)
Please refer to this article.

PRB: File Locked When PictureBox Image Property Set to File   [vCSharpnetkb]
http://support.microsoft.com/support/kb/articles/q311/7/54.asp

Best Regards,

Alick Ye

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. Copy right, 2002 Microsoft Corporation.
All rights reserved.

--------------------
Content-Class: urn:content-classes:message


Subject: Question on PictureBox.Image = Image.FromFile(aFile)
Date: Mon, 29 Apr 2002 19:24:48 -0700
Lines: 9

MIME-Version: 1.0
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcHv7jOQ3qoRy1WqTcinUzyApRKm8Q==
Newsgroups: microsoft.public.dotnet.languages.vb
Path: cpmsftngxa07
Xref: cpmsftngxa07 microsoft.public.dotnet.languages.vb:42579
NNTP-Posting-Host: TKMSFTNGXA08 10.201.226.36
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Hi,
Loading a picturebox from file e.g.
PictureBox.Image = Image.FromFile(aFile) will lock the
source file an make it unoperatinal. How do you unlock
the source file?

Thanks so much

Kelly



Sat, 16 Oct 2004 18:01:25 GMT  
 Question on PictureBox.Image = Image.FromFile(aFile)
Thanks Charles,
It worked for me :)
thanks so much
Kelly
Quote:
>-----Original Message-----
>Try Something like this....

>- Charles

>----------------------------------------
>Dim fsBLOBFile As New FileStream(strBLOBFilePath, _
>FileMode.Open, FileAccess.Read)
>Dim bytBLOBData(fsBLOBFile.Length() - 1) As Byte

>fsBLOBFile.Read(bytBLOBData, 0, bytBLOBData.Length)
>ImageBox.Image.FromStream(fsBLOBFile)
>fsBLOBFile.Close()
>-----------------------------------------------



>> Hi,
>> Loading a picturebox from file e.g.
>> PictureBox.Image = Image.FromFile(aFile) will lock the
>> source file an make it unoperatinal. How do you unlock
>> the source file?

>> Thanks so much

>> Kelly

>.



Sat, 16 Oct 2004 21:49:17 GMT  
 Question on PictureBox.Image = Image.FromFile(aFile)
Thnaks for the article Alice

Quote:
>-----Original Message-----
>Please refer to this article.

>PRB: File Locked When PictureBox Image Property Set to

File   [vcsharpnetkb]
Quote:
>http://support.microsoft.com/support/kb/articles/q311/7/5
4.asp

>Best Regards,

>Alick Ye

>This posting is provided "AS IS" with no warranties, and
confers no rights.
>You assume all risk for your use. Copy right, 2002

Microsoft Corporation.
Quote:
>All rights reserved.

>--------------------
>Content-Class: urn:content-classes:message


>Subject: Question on PictureBox.Image = Image.FromFile
(aFile)
>Date: Mon, 29 Apr 2002 19:24:48 -0700
>Lines: 9

>MIME-Version: 1.0
>Content-Type: text/plain;
>    charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>Thread-Index: AcHv7jOQ3qoRy1WqTcinUzyApRKm8Q==
>Newsgroups: microsoft.public.dotnet.languages.vb
>Path: cpmsftngxa07
>Xref: cpmsftngxa07

microsoft.public.dotnet.languages.vb:42579

- Show quoted text -

Quote:
>NNTP-Posting-Host: TKMSFTNGXA08 10.201.226.36
>X-Tomcat-NG: microsoft.public.dotnet.languages.vb

>Hi,
>Loading a picturebox from file e.g.
>PictureBox.Image = Image.FromFile(aFile) will lock the
>source file an make it unoperatinal. How do you unlock
>the source file?

>Thanks so much

>Kelly

>.



Sat, 16 Oct 2004 21:50:11 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. OUT OF MEMORY issues when using Picturebox and image.fromfile command

2. Image - FromFile bug?

3. File Lock when Image.FromFile is used. (Beta2)

4. load a Jpeg image into a picturebox or image control

5. Loaded image in Image or PictureBox control

6. Loading an image from a webserver into a PictureBox or Image

7. Error loading GIF or JPG image in PictureBox or Image controls

8. Display Image in picturebox from db image field without temp file

9. Color Count of image in an image (or picturebox) control

10. Help!! Loading PictureBox FromStream and PictureBox.Image.Save

11. picturebox / image question

12. Wide Image in PictureBox and other questions

 

 
Powered by phpBB® Forum Software