示例#1
0
        private void GDI_DrawColumnDrag(PaintEventArgs e)
        {
            if (_columnDown != null && _columnDownMoved && _currentX.HasValue && _currentY.HasValue && IsHoveringOnColumnCell)
            {
                int x1 = _currentX.Value - (_columnDown.Width.Value / 2);
                int y1 = _currentY.Value - (CellHeight / 2);
                int x2 = x1 + _columnDown.Width.Value;
                int y2 = y1 + CellHeight;

                _gdi.SetSolidPen(_backColor);
                _gdi.DrawRectangle(x1, y1, x2, y2);
                _gdi.PrepDrawString(_normalFont, _foreColor);
                _gdi.DrawString(_columnDown.Text, new Point(x1 + CellWidthPadding, y1 + CellHeightPadding));
            }
        }
示例#2
0
        protected override void OnPaint(PaintEventArgs e)
        {
            using (var LCK = Gdi.LockGraphics(e.Graphics))
            {
                Gdi.StartOffScreenBitmap(Width, Height);

                // White Background
                Gdi.SetBrush(Color.White);
                Gdi.SetSolidPen(Color.White);
                Gdi.FillRectangle(0, 0, Width, Height);


                Gdi.DrawString("Hello World", new Point(10, 10));

                Gdi.CopyToScreen();
                Gdi.EndOffScreenBitmap();
            }
        }