F
Freesc
Hi,there
i 'm writing an application about bitmap displaying.But i find it
works not very well because of the terrorable performance .
here's my code
/// <summary>
/// Get BMP according to the FrameNumber,then display
/// </summary>
/// <param name="FrameNo"></param>
/// <param name="FandR_Flag">direction</param>
/// <returns></returns>
public Bitmap createImage(int FrameNo, int FandR_Flag)
{
string xustr;
byte[] xutest;
xustr = "CAM";
//find image,cost about 1ms
xutest = ri.Fun_GetSpeData(xustr, FrameNo, FandR_Flag);
//read byte[] into memostream,cost about 1ms
MemoryStream ms = new MemoryStream(xutest, 0, xutest.Length);
//here cost 423ms to construct an bmp, what happened
here?!!!!!!!!!!!!!!!!!!!!!!!!
Bitmap bmp = new Bitmap(ms);
xutest = null;
ms.Close();
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
return bmp;
}
Any suggestion?
Thanks in advance~
Regards,
Freesc
i 'm writing an application about bitmap displaying.But i find it
works not very well because of the terrorable performance .
here's my code
/// <summary>
/// Get BMP according to the FrameNumber,then display
/// </summary>
/// <param name="FrameNo"></param>
/// <param name="FandR_Flag">direction</param>
/// <returns></returns>
public Bitmap createImage(int FrameNo, int FandR_Flag)
{
string xustr;
byte[] xutest;
xustr = "CAM";
//find image,cost about 1ms
xutest = ri.Fun_GetSpeData(xustr, FrameNo, FandR_Flag);
//read byte[] into memostream,cost about 1ms
MemoryStream ms = new MemoryStream(xutest, 0, xutest.Length);
//here cost 423ms to construct an bmp, what happened
here?!!!!!!!!!!!!!!!!!!!!!!!!
Bitmap bmp = new Bitmap(ms);
xutest = null;
ms.Close();
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
return bmp;
}
Any suggestion?
Thanks in advance~
Regards,
Freesc