Skip to main content
GameDev.net gamedev.net
🔒 Locked

Loading an image from a database

Started by bzroom Aug 6, 2003 at 1:44 PM 1 replies 500+ views
Original Post
bzroom
bzroom
This is my code to retreive a image from a database, for some reason the image.fromfile... keeps the file open after i load it, so i can''t delete it. If i can''t delete it (And because its still open) i can''t load hte next image from the database.
            If rcs.Fields("sig").Value Is System.DBNull.Value Then
                PictureBox1.Image = Nothing
                Exit Sub
            End If

            strStream.Write(rcs.Fields("sig").Value)


            strStream.SaveToFile("C:\sTemp.bmp", ADODB.SaveOptionsEnum.adSaveCreateOverWrite)
            strStream.Close()

            PictureBox1.Image = Image.FromFile("C:\sTemp.bmp")

            Kill("c:\stemp.bmp")
Its in vb.net, Please help!, Thanks.
Sneftel
Sneftel
Heh, uh, why are you creating the temporary file in the first place? Why not just set the image from the stream directly?


How appropriate. You fight like a cow.
bzroom
bzroom
because image.fromstream takes an io.stream and im using adodb.stream, i''ve tried

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.