public void Render(IDrawingContext dc, RectFloat clipRect, float opacity, BitmapInterpolationMode interpolationMode)
        {
            if (!this.beforeRenderCalled || this.afterRenderCalled)
            {
                throw new PaintDotNet.InternalErrorException();
            }
            this.renderCalled = true;
            if (this.isRendering)
            {
                throw new InvalidOperationException("Render() is not reentrant");
            }
            RectInt32 sourceRect = RectInt32.Intersect(clipRect.Int32Bound, this.owner.Document.Bounds());

            if (sourceRect.HasPositiveArea)
            {
                this.isRendering = true;
                try
                {
                    bool flag = dc.IsSupported(RenderTargetType.Software, null, null, null);
                    foreach (PointInt32 num3 in this.tileMathHelper.EnumerateTileOffsets(sourceRect))
                    {
                        if (flag)
                        {
                            IBitmap <ColorPbgra32> bitmap2 = this.tileBuffers[num3.Y][num3.X];
                            if ((bitmap2 != null) && bitmap2.IsDisposed)
                            {
                                continue;
                            }
                        }
                        IDeviceBitmap bitmap = this.deviceBitmaps[num3.Y][num3.X];
                        if (bitmap != null)
                        {
                            RectInt32 tileSourceRect = this.tileMathHelper.GetTileSourceRect(num3.X, num3.Y);
                            RectFloat?srcRect        = null;
                            dc.DrawBitmap(bitmap, new RectFloat?(tileSourceRect), opacity, interpolationMode, srcRect);
                        }
                    }
                }
                finally
                {
                    this.isRendering = false;
                }
            }
        }
Пример #2
0
 public void DrawBitmap(IDeviceBitmap bitmap, RectFloat?dstRect, float opacity, BitmapInterpolationMode interpolationMode, RectFloat?srcRect)
 {
     base.innerRefT.DrawBitmap(bitmap, dstRect, opacity, interpolationMode, srcRect);
 }
Пример #3
0
 public void FillOpacityMask(IDeviceBitmap opacityMask, IBrush brush, OpacityMaskContent content, RectFloat?dstRect, RectFloat?srcRect)
 {
     base.innerRefT.FillOpacityMask(opacityMask, brush, content, dstRect, srcRect);
 }