Click here to Skip to main content
16,005,169 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionimages in vb.net Pin
salam ellayan18-Jun-08 10:37
salam ellayan18-Jun-08 10:37 
AnswerRe: images in vb.net Pin
nishkarsh_k18-Jun-08 17:01
nishkarsh_k18-Jun-08 17:01 
GeneralRe: images in vb.net Pin
salam ellayan18-Jun-08 22:42
salam ellayan18-Jun-08 22:42 
GeneralRe: images in vb.net Pin
nishkarsh_k18-Jun-08 23:53
nishkarsh_k18-Jun-08 23:53 
GeneralRe: images in vb.net Pin
salam ellayan19-Jun-08 22:23
salam ellayan19-Jun-08 22:23 
GeneralRe: images in vb.net Pin
nishkarsh_k22-Jun-08 23:35
nishkarsh_k22-Jun-08 23:35 
GeneralRe: images in vb.net Pin
salam ellayan23-Jun-08 4:29
salam ellayan23-Jun-08 4:29 
GeneralRe: images in vb.net Pin
nishkarsh_k23-Jun-08 21:26
nishkarsh_k23-Jun-08 21:26 
Code to read the IMAGE from PICTURE BOX

Imports System
Imports System.IO
Imports System.Text



'Declare a memory stream
Dim ms As MemoryStream = New MemoryStream()

'Get the image into ms from picture box (Treating it as a gif, you can chuse ur format)
picBox.Image.Save(ms, picBox.Image.RawFormat.Gif)

'Define a byte stream of length of memory stream and tranfer the ms to it
Dim bytes(CInt(ms.Length - 1)) As Byte

ms.Seek(0, SeekOrigin.Begin)
ms.Read(bytes, 0, CInt(ms.Length))

ms.Dispose()


So this code will make it sure that you have the image in a array of bytes and you can do what u want with it..

Once you read the picture back from DB as byte array you can display it as

Dim ar(dataLength) As Byte

myReader.GetBytes(0, 0, ar, 0, dataLength)
myReader.Close()

'Define a memory stream
Dim b As New MemoryStream(ar)

picBOx.Image = Image.FromStream(b)

b.Close()


Good Luck
Nishkarsh
GeneralRe: images in vb.net Pin
salam ellayan24-Jun-08 3:23
salam ellayan24-Jun-08 3:23 
GeneralRe: images in vb.net Pin
salam ellayan29-Jun-08 5:53
salam ellayan29-Jun-08 5:53 
GeneralRe: images in vb.net Pin
salam ellayan2-Jul-08 6:21
salam ellayan2-Jul-08 6:21 
GeneralRe: images in vb.net Pin
nishkarsh_k3-Jul-08 1:10
nishkarsh_k3-Jul-08 1:10 
GeneralC# Pin
salam ellayan24-Sep-08 22:14
salam ellayan24-Sep-08 22:14 
Questionreply Pin
salam ellayan18-Jun-08 10:32
salam ellayan18-Jun-08 10:32 
AnswerRe: reply Pin
Colin Angus Mackay18-Jun-08 11:06
Colin Angus Mackay18-Jun-08 11:06 
GeneralRe: reply Pin
Paul Conrad18-Jun-08 20:28
professionalPaul Conrad18-Jun-08 20:28 
AnswerRe: reply Pin
MarkB77718-Jun-08 20:14
MarkB77718-Jun-08 20:14 
AnswerRe: reply Pin
Ashfield18-Jun-08 21:15
Ashfield18-Jun-08 21:15 
QuestionCounting the occurences of a particular word Pin
Saul Johnson18-Jun-08 9:05
Saul Johnson18-Jun-08 9:05 
AnswerRe: Counting the occurences of a particular word Pin
Saul Johnson18-Jun-08 10:18
Saul Johnson18-Jun-08 10:18 
Questiongraduation project Pin
salam ellayan18-Jun-08 8:45
salam ellayan18-Jun-08 8:45 
AnswerRe: graduation project Pin
Ashfield18-Jun-08 9:00
Ashfield18-Jun-08 9:00 
JokeRe: graduation project Pin
Hasan Jaffal18-Jun-08 19:55
Hasan Jaffal18-Jun-08 19:55 
GeneralRe: graduation project Pin
salam ellayan18-Jun-08 22:44
salam ellayan18-Jun-08 22:44 
GeneralRe: graduation project Pin
Hasan Jaffal19-Jun-08 1:53
Hasan Jaffal19-Jun-08 1:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.