Click here to Skip to main content
16,009,068 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: DirectX 9 Pin
Jim Taylor1-Aug-04 6:15
Jim Taylor1-Aug-04 6:15 
GeneralIO File Deletion Error Pin
payal sheth29-Jul-04 21:49
payal sheth29-Jul-04 21:49 
GeneralRe: IO File Deletion Error Pin
Dave Kreskowiak30-Jul-04 3:04
mveDave Kreskowiak30-Jul-04 3:04 
Questionhow do you use request command Pin
lxhan29-Jul-04 21:38
lxhan29-Jul-04 21:38 
AnswerRe: how do you use request command Pin
Dave Kreskowiak30-Jul-04 3:01
mveDave Kreskowiak30-Jul-04 3:01 
QuestionCan some 1 plz send me a cyber cafe system code? Pin
vendem29-Jul-04 17:23
vendem29-Jul-04 17:23 
AnswerRe: Can some 1 plz send me a cyber cafe system code? Pin
Dave Kreskowiak30-Jul-04 1:15
mveDave Kreskowiak30-Jul-04 1:15 
GeneralMemoryStream to BLOB and "invalid parameter used" Pin
TimGade29-Jul-04 11:06
TimGade29-Jul-04 11:06 
I want to save an image located on the clipboard to an IMAGE field in SQLServer without having to save to disk first.

When I run the code listed under CASE1 everything works file.

When I run the code listed under CASE2 I get a "invalid parameter used" error.
Windows does not recognize this as an image file when the stream is saved to file after retrieving from the database.

Does anybody have a solution why the FileStream works and the MemoryStream doesn't?

Tim



Dim oImgObj As Image = oDataObject.GetData(DataFormats.Bitmap, True)

'CASE1
oImgObj.Save("c:\Test.bmp", Imaging.ImageFormat.Bmp)
Dim fs As New FileStream("c:\Test.bmp", FileMode.OpenOrCreate, FileAccess.Read)
Dim bImageFile(fs.Length - 1) As Byte
fs.Read(bImageFile, 0, fs.Length)
fs.Close()

'CASE2
Dim ms As New MemoryStream
oImgObj.Save(ms, Imaging.ImageFormat.Bmp)
Dim bImageMemory(ms.Length - 1) As Byte
ms.Read(bImageMemory, 0, ms.Length)
ms.Close()


Generalvb.net versus c# Pin
ckoverman29-Jul-04 6:03
ckoverman29-Jul-04 6:03 
GeneralRe: vb.net versus c# Pin
Nemanja Trifunovic29-Jul-04 6:24
Nemanja Trifunovic29-Jul-04 6:24 
GeneralRe: vb.net versus c# Pin
Dave Kreskowiak29-Jul-04 6:28
mveDave Kreskowiak29-Jul-04 6:28 
GeneralDataGrid - how to get the sort arrow in column header Pin
T Manjaly29-Jul-04 5:05
T Manjaly29-Jul-04 5:05 
GeneralRe: DataGrid - how to get the sort arrow in column header Pin
Dave Kreskowiak29-Jul-04 6:34
mveDave Kreskowiak29-Jul-04 6:34 
GeneralRe: DataGrid - how to get the sort arrow in column header Pin
T Manjaly29-Jul-04 7:25
T Manjaly29-Jul-04 7:25 
GeneralRe: DataGrid - how to get the sort arrow in column header Pin
Dave Kreskowiak29-Jul-04 8:11
mveDave Kreskowiak29-Jul-04 8:11 
Generaldatagrid problem Pin
Asim N.29-Jul-04 2:15
Asim N.29-Jul-04 2:15 
GeneralRe: datagrid problem Pin
Dave Kreskowiak29-Jul-04 6:09
mveDave Kreskowiak29-Jul-04 6:09 
GeneralConvert Print preview to jpeg file Pin
vancouver77728-Jul-04 21:27
vancouver77728-Jul-04 21:27 
GeneralTimer Function Pin
Mega128-Jul-04 16:57
Mega128-Jul-04 16:57 
GeneralRe: Timer Function Pin
Dave Kreskowiak29-Jul-04 6:04
mveDave Kreskowiak29-Jul-04 6:04 
GeneralWIA called in VB6 Pin
PLTEH28-Jul-04 16:17
PLTEH28-Jul-04 16:17 
GeneralRe: WIA called in VB6 Pin
Dave Kreskowiak29-Jul-04 5:50
mveDave Kreskowiak29-Jul-04 5:50 
GeneralRe: WIA called in VB6 Pin
PLTEH29-Jul-04 15:57
PLTEH29-Jul-04 15:57 
GeneralRe: WIA called in VB6 Pin
Dave Kreskowiak30-Jul-04 1:10
mveDave Kreskowiak30-Jul-04 1:10 
GeneralAccessing MIDI in VB Pin
Kevnar27-Jul-04 20:04
Kevnar27-Jul-04 20:04 

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.