Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Image to Byte Array
Author:
Visual C# Kicks
Website:
http://www.vcskicks.com/
Submitted:
5/22/2009
Version:
VB 2005
Compatibility:
VB 2005, VB 2008
Category:
Graphics
Views:
40339
Convert an image to an array of raw bytes in memory.
Declarations:
'none
Code:
Public Shared Function ImageToByte(ByVal img As Image) As Byte() Dim imgStream As MemoryStream = New MemoryStream() img.Save(imgStream, System.Drawing.Imaging.ImageFormat.Png) imgStream.Close() Dim byteArray As Byte() = imgStream.ToArray() imgStream.Dispose() Return byteArray End Function
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement