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; this.CurrentFont = renderSurface.CurrentFont; }
//---------------------------------------------- /// <summary> /// set-up CpuBlit(software-rendering surface) /// </summary> protected virtual void SetupCpuBlitRenderSurface() { //*** _memBmp = new MemBitmap(_width, _height); #if DEBUG _memBmp._dbugNote = "CpuBlitGLESUIElement.SetupCpuBlitRenderSurface()"; #endif _aggPainter = AggPainter.Create(_memBmp); //optional if we want to print text on agg surface _aggPainter.CurrentFont = new PixelFarm.Drawing.RequestFont("Tahoma", 10); _aggPainter.TextPrinter = new PixelFarm.Drawing.Fonts.FontAtlasTextPrinter(_aggPainter); _memBitmapBinder = new MemBitmapBinder(_memBmp, false); // }
//---------------------------------------------- /// <summary> /// set-up CpuBlit(software-rendering surface) /// </summary> protected virtual void SetupCpuBlitRenderSurface() { //*** _memBmp = new MemBitmap(_width, _height); #if DEBUG _memBmp._dbugNote = "CpuBlitGLESUIElement.SetupCpuBlitRenderSurface()"; #endif _aggPainter = AggPainter.Create(_memBmp); //optional if we want to print text on agg surface _aggPainter.CurrentFont = MyFontSettings.DefaultRootGraphicsFont;// _aggPainter.TextPrinter = new PixelFarm.CpuBlit.BitmapAtlas.FontAtlasTextPrinter(_aggPainter); _memBitmapBinder = new MemBitmapBinder(_memBmp, false); // }
protected override void SetupCpuBlitRenderSurface() { //don't call base //1. we create gdi plus draw board var renderSurface = new PixelFarm.Drawing.WinGdi.GdiPlusRenderSurface(_width, _height); _gdiDrawBoard = new PixelFarm.Drawing.WinGdi.GdiPlusDrawBoard(renderSurface); _gdiDrawBoard.CurrentFont = new RequestFont("Tahoma", 10); //2. create actual bitmap that share 'bitmap mem' with gdiPlus Render surface _memBmp = renderSurface.GetMemBitmap(); //3. create painter from the agg bmp (then we will copy the 'client' gdi mem surface to the GL) _aggPainter = renderSurface.GetAggPainter();//** //*** // //... // _memBitmapBinder = new MemBitmapBinder(_memBmp, false); _memBitmapBinder.BitmapFormat = BitmapBufferFormat.BGR;//** }