C#: Bitmap Creation using bytes array

前端 未结 2 1073
萌比男神i
萌比男神i 2021-01-21 23:50

I am trying to dynamically create a Bitmap Image using byte array using following code

Bitmap GetImage()
{
    IntPtr  ip = Marshal.AllocCoTaskMem(imagesize);

          


        
2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-22 00:44

    If you know the dimensions in advance, why not creating the bitmap and use the Bitmap.LockBits method to get the input buffer address?

提交回复
热议问题