Click here to Skip to main content
15,921,622 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralApplication with Socket Programming Pin
rajamca20034-Apr-04 20:39
rajamca20034-Apr-04 20:39 
GeneralRe: Application with Socket Programming Pin
adarsh_m4-Apr-04 23:44
adarsh_m4-Apr-04 23:44 
GeneralClickety Pin
Colin Angus Mackay5-Apr-04 0:22
Colin Angus Mackay5-Apr-04 0:22 
GeneralCopying a class (copy constructor) Pin
PaleyX4-Apr-04 12:29
PaleyX4-Apr-04 12:29 
GeneralRe: Copying a class (copy constructor) Pin
Dave Kreskowiak4-Apr-04 17:47
mveDave Kreskowiak4-Apr-04 17:47 
GeneralDependency problems in deploying a VB.Net Application Pin
nvmoss4-Apr-04 9:01
nvmoss4-Apr-04 9:01 
GeneralRe: Dependency problems in deploying a VB.Net Application Pin
Wayne Phipps4-Apr-04 9:08
Wayne Phipps4-Apr-04 9:08 
GeneralUsing NetworkStream Pin
Wayne Phipps4-Apr-04 8:02
Wayne Phipps4-Apr-04 8:02 
I am attempting to write an image to a network stream and am experiencing dificulties.

I have tried something allong the lines of:
<br />
myImage.Save(myNetworkStream, System.Drawing.Imaging.ImageFormat.Bmp)<br />

This causes a exception:
An unhandled exception of type 'System.Runtime.InteropServices.ExternalException' occurred in system.drawing.dll

Additional information: A generic error occurred in GDI+.


So I changed my code to:
<br />
            Dim ms As New System.IO.MemoryStream()<br />
            ''  write the image to the memory stream<br />
            myImage.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp)<br />
            ''  declare a byte array <br />
            Dim b(ms.Length - 1) As Byte<br />
            ''  set the position within the memory stream<br />
            ms.Position = 0<br />
            ''  read the memory stream into byte array<br />
            ms.Read(b, 0, ms.Length)<br />
            ''  write the byte array into the network stream<br />
            myNetworkStream.Write(b, 0, b.Length)<br />


Is there a better way? Can anyone see why the first method threw an exception?


Regards

Wayne Phipps
____________

Time is the greatest teacher... unfortunately, it kills all of its students
LearnVisualStudio.Net

Generalvb net Pin
timark4-Apr-04 5:28
timark4-Apr-04 5:28 
GeneralRe: vb net Pin
Dave Kreskowiak4-Apr-04 17:52
mveDave Kreskowiak4-Apr-04 17:52 
GeneralXML and VB.NET Pin
PaleyX3-Apr-04 10:35
PaleyX3-Apr-04 10:35 
GeneralRe: XML and VB.NET Pin
PaleyX4-Apr-04 3:07
PaleyX4-Apr-04 3:07 
Questionhow to print out the content of picturebox and richtexbox using print dialog? Pin
MJay3-Apr-04 3:02
MJay3-Apr-04 3:02 
AnswerRe: how to print out the content of picturebox and richtexbox using print dialog? Pin
Ricci Gian Maria4-Apr-04 21:19
Ricci Gian Maria4-Apr-04 21:19 
GeneralData load for Winsock Client Pin
DhruboMitra2-Apr-04 19:43
DhruboMitra2-Apr-04 19:43 
GeneralRe: Data load for Winsock Client Pin
Dave Kreskowiak3-Apr-04 2:05
mveDave Kreskowiak3-Apr-04 2:05 
GeneralRe: Data load for Winsock Client Pin
DhruboMitra8-Apr-04 18:09
DhruboMitra8-Apr-04 18:09 
GeneralProblem with GetWindowText() in VB Pin
ndalal2-Apr-04 9:12
ndalal2-Apr-04 9:12 
GeneralRe: Problem with GetWindowText() in VB Pin
Dave Kreskowiak2-Apr-04 10:01
mveDave Kreskowiak2-Apr-04 10:01 
GeneralStrong Naming Pin
nvmoss2-Apr-04 6:09
nvmoss2-Apr-04 6:09 
GeneralRe: Strong Naming Pin
Dave Kreskowiak2-Apr-04 6:21
mveDave Kreskowiak2-Apr-04 6:21 
GeneralRe: Strong Naming Pin
nvmoss3-Apr-04 7:26
nvmoss3-Apr-04 7:26 
QuestionHow to Kill a particular process Pin
ndalal2-Apr-04 5:14
ndalal2-Apr-04 5:14 
AnswerRe: How to Kill a particular process Pin
Dave Kreskowiak2-Apr-04 6:03
mveDave Kreskowiak2-Apr-04 6:03 
GeneralRe: How to Kill a particular process Pin
ndalal2-Apr-04 7:10
ndalal2-Apr-04 7:10 

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.