Saving a Bitmap or Image type to a Byte() in a database - SQL Server 2005 : DOTNET
This is a discussion on Saving a Bitmap or Image type to a Byte() in a database - SQL Server 2005 within the DOTNET forums in Framework and Interface Programming category; Thanks Bob for previous link. The problem now is that the images are stored in the database as a Byte( ) , ie a Byte array. So I am having trouble converting the System.Drawing.Bitmap type into a Byte( ). CType won't do this. Can anyone help me do this with Visual Basic 2005. Thanks Jason...
| DOTNET Discussion forums related to Microsoft Dot net technologies, CSharp and other related items |
![]() |
| | LinkBack | Thread Tools |
|
#1
| |||
| |||
| The problem now is that the images are stored in the database as a Byte( ) , ie a Byte array. So I am having trouble converting the System.Drawing.Bitmap type into a Byte( ). CType won't do this. Can anyone help me do this with Visual Basic 2005. Thanks Jason |
|
#2
| |||
| |||
| <jason.smart@email.cs.nsw.gov.au> wrote in message news:OnJSzym8GHA.4012@TK2MSFTNGP04.phx.gbl... > Thanks Bob for previous link. > The problem now is that the images are stored in the database as a Byte( ) > , ie a Byte array. So I am having trouble converting the > System.Drawing.Bitmap type into a Byte( ). CType won't do this. Can anyone > help me do this with Create a memory stream from the byte array and then create the image from the stream. > Visual Basic 2005. > Thanks > Jason > |
|
#3
| |||
| |||
| Thanks Michael, This is what I used and it works fine, note that bitmap is of type System.Drawing.Bitmap Dim memoryStream As New MemoryStream() bitmap.Save(memoryStream, bitmap.RawFormat) Dim imgArray() As Byte = memoryStream.GetBuffer memoryStream.Close() "Michael C" <nospam@nospam.com> wrote in message news:u0%238w0m8GHA.3552@TK2MSFTNGP03.phx.gbl... > <jason.smart@email.cs.nsw.gov.au> wrote in message > news:OnJSzym8GHA.4012@TK2MSFTNGP04.phx.gbl... >> Thanks Bob for previous link. >> The problem now is that the images are stored in the database as a >> Byte( ) , ie a Byte array. So I am having trouble converting the >> System.Drawing.Bitmap type into a Byte( ). CType won't do this. Can >> anyone help me do this with > > Create a memory stream from the byte array and then create the image from > the stream. > >> Visual Basic 2005. >> Thanks >> Jason >> > > |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to create a CLR DLL for Sql Server 2005? Is it just any .net class library that you can load into Sql Server 2005 or is there some special project type that I need to start with? | usenet | DOTNET | 2 | 11-13-2007 08:44 PM |
| How to create a CLR DLL for Sql Server 2005? Is it just any .net class library that you can load into Sql Server 2005 or is there some special project type that I need to start with? | usenet | DOTNET | 2 | 10-30-2007 08:13 PM |
| How to create a CLR DLL for Sql Server 2005? Is it just any .net class library that you can load into Sql Server 2005 or is there some special project type that I need to start with? | usenet | XML SOAP | 2 | 10-28-2007 05:05 AM |
| Getting raw bitmap byte data from bitmap image | usenet | DOTNET | 2 | 10-31-2006 09:51 AM |
| Including ICC profile when saving a image using the bitmap object? | usenet | DOTNET | 2 | 10-25-2005 10:29 AM |
All times are GMT -5. The time now is 12:49 AM.



