I'm using the attached function to get an image (.ico file) stored in a SQL
field.
Anyone knows a better method? This is really inefficient.
internal static Image IconFromField(object xData)
{
byte[] bytBLOBData = ( ( byte[] )( xData ) );
for (int A = 0; A < Math.Min(bytBLOBData.Length, 200); A++ )
{
try
{
System.IO.MemoryStream stmBLOBData = new System.IO.MemoryStream(bytBLOBData,
A, bytBLOBData.Length - A);
return Image.FromStream(stmBLOBData).GetThumbnailImage(16 , 16, null,
IntPtr.Zero);
}
catch
{
}
}
return null;
}