예제 #1
0
        static Bitmap ColorToBitmap(int w, int h, Color[] argb)
        {
            //WL("argb.Length = "+argb.Length+" buff = "+buffer.Length);
            Bitmap     bmp  = new Bitmap(w, h, PixelFormat.Format32bppArgb);
            LockBitmap lbmp = new LockBitmap(bmp);

            lbmp.LockBits();
            for (int hi = 0; hi < h; hi++)
            {
                for (int wi = 0; wi < w; wi++)
                {
                    Color c = argb[hi * w + wi];
                    lbmp.SetPixel(wi, hi, c);
                }
            }
            lbmp.UnlockBits();
            return(bmp);
        }
예제 #2
0
 static Bitmap ColorToBitmap(int w,int h, Color[] argb)
 {
     //WL("argb.Length = "+argb.Length+" buff = "+buffer.Length);
     Bitmap bmp = new Bitmap(w, h, PixelFormat.Format32bppArgb);
     LockBitmap lbmp = new LockBitmap(bmp);
     lbmp.LockBits();
     for (int hi = 0; hi < h; hi++)
     {
         for (int wi = 0; wi < w; wi++)
         {
             Color c = argb[hi * w + wi];
             lbmp.SetPixel(wi, hi, c);
         }
     }
     lbmp.UnlockBits();
     return bmp;
 }