public override void BlitFrom(DrawBoard src, float srcX, float srcY, float srcW, float srcH, float dstX, float dstY) { if (!src.IsGpuDrawBoard) { //cpu draw board BitmapBufferProvider bmpProvider = src.GetInternalBitmapProvider(); if (_tmpGLBmp == null) { _tmpGLBmp = new GLBitmap(bmpProvider); } else { _tmpGLBmp.UpdateTexture(new Rectangle((int)srcX, (int)srcY, (int)srcW, (int)srcH)); } //--------- this.DrawImage(_tmpGLBmp, new RectangleF((int)dstX, (int)dstY, (int)srcW, (int)srcH), //dst new RectangleF((int)srcX, (int)srcY, (int)srcW, (int)srcH)); //src } else { //TODO: implement this.... } }
public GLBitmap(BitmapBufferProvider bmpBuffProvider) { _width = bmpBuffProvider.Width; _height = bmpBuffProvider.Height; _bmpBufferProvider = bmpBuffProvider; this.IsYFlipped = bmpBuffProvider.IsYFlipped; this.BitmapFormat = bmpBuffProvider.BitmapFormat; }
public GdiPlusDrawBoard(GdiPlusRenderSurface renderSurface) { _left = 0; _top = 0; _right = renderSurface.Width; _bottom = renderSurface.Height; _gdigsx = renderSurface; _painter = _gdigsx.GetAggPainter(); _memBmpBinder = new MemBitmapBinder(renderSurface.GetMemBitmap(), false); _memBmpBinder.BitmapFormat = BitmapBufferFormat.BGR; }