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(); }
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(); }
public JoinedQueryDataSet(FillDelegate <object> fillMember, IReadOnlyList <QueryToAttach> queriesToPrefetch) { this.FillMember = fillMember; this.QueriesToPrefetch = queriesToPrefetch; }
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(); } }