Exemplo n.º 1
0
        public unsafe void FillBitmap( FillDelegate _Delegate )
        {
            BitmapData	LockedBitmap = m_Bitmap.LockBits( new Rectangle( 0, 0, m_Bitmap.Width, m_Bitmap.Height ), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb );

            int	W = LockedBitmap.Width;
            int H = LockedBitmap.Height;
            for ( int Y=0; Y < LockedBitmap.Height; Y++ )
            {
                byte*	pScanline = (byte*) LockedBitmap.Scan0.ToPointer() + LockedBitmap.Stride * Y;
                for ( int X=0; X < LockedBitmap.Width; X++ )
                {
                    uint	Color = _Delegate( X, Y, W, H );
                    *pScanline++ = (byte) ((Color >> 0) & 0xFF);
                    *pScanline++ = (byte) ((Color >> 8) & 0xFF);
                    *pScanline++ = (byte) ((Color >> 16) & 0xFF);
                    *pScanline++ = (byte) ((Color >> 24) & 0xFF);
                }
            }

            m_Bitmap.UnlockBits( LockedBitmap );
            Refresh();
        }
Exemplo n.º 2
0
        public unsafe void              FillBitmap(FillDelegate _Delegate)
        {
            BitmapData LockedBitmap = m_Bitmap.LockBits(new Rectangle(0, 0, m_Bitmap.Width, m_Bitmap.Height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);

            int W = LockedBitmap.Width;
            int H = LockedBitmap.Height;

            for (int Y = 0; Y < LockedBitmap.Height; Y++)
            {
                byte *pScanline = (byte *)LockedBitmap.Scan0.ToPointer() + LockedBitmap.Stride * Y;
                for (int X = 0; X < LockedBitmap.Width; X++)
                {
                    uint Color       = _Delegate(X, Y, W, H);
                    *    pScanline++ = (byte)((Color >> 0) & 0xFF);
                    *    pScanline++ = (byte)((Color >> 8) & 0xFF);
                    *    pScanline++ = (byte)((Color >> 16) & 0xFF);
                    *    pScanline++ = (byte)((Color >> 24) & 0xFF);
                }
            }

            m_Bitmap.UnlockBits(LockedBitmap);
            Refresh();
        }
Exemplo n.º 3
0
 public JoinedQueryDataSet(FillDelegate <object> fillMember, IReadOnlyList <QueryToAttach> queriesToPrefetch)
 {
     this.FillMember        = fillMember;
     this.QueriesToPrefetch = queriesToPrefetch;
 }
Exemplo n.º 4
0
 private void SearchAndFillByName(String[] searchInfo, FillDelegate fill)
 {
     SearchParam search = null;
     SearchSelect select = null;
     try
     {
         search = new SearchParam(searchInfo[0], searchInfo[1]);
         if(search.ShowDialog(this) != DialogResult.OK)
         {
             return;
         }
         select = new SearchSelect(searchInfo[2] + "'%" + search.SearchString + "%'");
         if(select.ShowDialog(this) != DialogResult.OK)
         {
             return;
         }
         fill(select.Line.ItemArray);
     }
     finally
     {
         if(search != null) search.Dispose();
         if(select != null) select.Dispose();
     }
 }