Scalabium Software

SMExport advertising
Knowledge for your independence'.
Home Delphi and C++Builder tips


#9: Convert the image to byte array

    private byte[] ImageToByteArray(Image img) 
    { 
        // stream to save the image to byte array 
        Stream ms = new MemoryStream(); 
        img.Save(ms, img.RawFormat); 
 
        // read to end 
        byte[] imgBytes = new byte[ms.Length-1]; 
        ms.Position = 0; 
        ms.Read(imgBytes, 0, imgBytes.Length); 
        ms.Close(); 
 
        return imgBytes; 
    }


Published: August 11, 2010

See also
 
SMExport suite
DBISAM Viewer
Excel Web-stream
Viewer for TNEF-files (winmail.dat)
ABA Picture Convert
Paradox Viewer
Viewer for MS Outlook Messages
Mail parser (ActiveX)
Clarion to Text converter
SMReport
 
 


Contact to webmaster

 

Borland Software Code Gear Scalabium Delphi tips

Copyright© 1998-2022, Scalabium Software. All rights reserved.
webmaster@scalabium.com

SMExport advertising