Works for me too.
"Barry" <bceggers@castcom.com> wrote in message
news:3v06t1t8g4ngj75t6jec1t155ovap1g9jt@4ax.com...
> This works for me... after you close the lcl_fso the file can be
> deleted, just don't get rid of the byte_old.
>
> Dim lcl_filename As System.String = "c:\temp\images\test.tif"
> Dim lcl_fso As New System.IO.FileStream(lcl_filename, _
> IO.FileMode.Open, IO.FileAccess.Read, IO.FileShare.Read)
> Dim byte_old() As Byte
> Dim tmpint As Integer = Convert.ToInt32(lcl_fso.Length())
> With lcl_fso
> ReDim byte_old(tmpint)
> .Read(byte_old, 0, tmpint)
> End With
> lcl_fso.Close()
> Dim memstream As New System.IO.MemoryStream(byte_old)
> Dim lcl_holdimage As System.Drawing.Image = _
> System.Drawing.Image.FromStream(memstream)
>
> HTH,
> Barry
>
> On Sat, 21 Jan 2006 15:18:37 -0500, " **Developer**"
> <REMOVEdeveloper@a-znet.com> wrote:
>
>>Sounds like a good work around.
>>Based on Lucky's post I looked to see if there file reference was
>>available - but found nothing.
>>
>>thanks
>>
>>"Michael D. Ober" <obermd.@.alum.mit.edu.nospam> wrote in message
>>news:ETvAf.1362$Dk.497@newsread3.news.pas.earthlink.net...
>>>
>>> I solved my problem (7 years ago) by keeping a "dummy.jpg" around that I
>>> assign to the control. Once I started doing this, I was able to delete
>>> the
>>> original file.
>>>
>>> Mike.
>>>
>>> " **Developer**" <REMOVEdeveloper@a-znet.com> wrote in message
>>> news:eNOMDVQHGHA.2320@TK2MSFTNGP11.phx.gbl...
>>>>
>>>> Thanks for the two replies.
>>>> Did you see Lucky's second post?
>>>> Sound reasonable to me.
>>>> How does it sound to you?
>>>>
>>>>
>>>>
>>>>
>>>> "Michael D. Ober" <obermd.@.alum.mit.edu.nospam> wrote in message
>>>> news:PUDzf.3782$Hd4.1869@newsread1.news.pas.earthlink.net...
>>>> >
>>>> > Based on my experience with the Kodak drivers, you get an error when
>>>> > you
>>>> > attempt to delete the file. Windows won't delete it later.
>>>> >
>>>> > Mike Ober.
>>>> >
>>>> > " **Developer**" <REMOVEdeveloper@a-znet.com> wrote in message
>>>> > news:uLJn$H8GGHA.1132@TK2MSFTNGP10.phx.gbl...
>>>> >>
>>>> >> What I mean
>>>> >> is the file there forever or does Window eventually delete it
>>>> >>
>>>> >>
>>>> >>
>>>> >>
>>>> >> " **Developer**" <REMOVEdeveloper@a-znet.com> wrote in message
>>>> >> news:OAR8Nh3GGHA.596@TK2MSFTNGP10.phx.gbl...
>>>> >> > What is the penalty for not deleting a temp file?
>>>> >> >
>>>> >> > Is that a way to go?
>>>> >> >
>>>> >> >
>>>> >> >
>>>> >> > "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in
>>> message
>>>> >> > news:uejMcQ3GGHA.2320@TK2MSFTNGP11.phx.gbl...
>>>> >> >>" **Developer**" <REMOVEdeveloper@a-znet.com> schrieb:
>>>> >> >>> When I get the image from the file the file remains locked so
>>>> >> >>> the
>>>> > Delete
>>>> >> >>> fails with a "used by another process"
>>>> >> >>
>>>> >> >> Check out the code snippets at
>>>> >> >> <URL:
http://dotnet.mvps.org/dotnet/code/graphics/#ImageNoLock>. >>>> >> >>
>>>> >> >> --
>>>> >> >> M S Herfried K. Wagner
>>>> >> >> M V P <URL:
http://dotnet.mvps.org/> >>>> >> >> V B <URL:
http://classicvb.org/petition/> >>>> >> >
>>>> >> >
>>>> >>
>>>> >>
>>>> >>
>>>> >
>>>> >
>>>> >
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>
> bceggersATcomcastDOTnet