Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
1662 | Nov 18,2002 08:05 PM UTC | Nov 20,2002 07:08 PM UTC | WinForms | 8 |
![]() |
Tags: GridControl |
protected override void OnDraw(Graphics g, Rectangle clientRectangle, int rowIndex, int colIndex, GridStyleInfo style) { if (clientRectangle.IsEmpty) return; // CellLayout layout = GetCellLayout(int rowIndex, int colIndex, GridStyleInfo style) if(style.Tag is Bitmap) { int cellWidth = clientRectangle.Width; int cellHeight = clientRectangle.Height; int bmpWidth = ((Bitmap) style.Tag).Width; int bmpHeight = ((Bitmap) style.Tag).Height; int left = clientRectangle.X + (cellWidth - bmpWidth) / 2; int top = clientRectangle.Y + (cellHeight - bmpHeight) / 2; g.DrawImage((Bitmap) style.Tag, left, top, bmpWidth, bmpHeight); } }
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.