コード例 #1
0
 public DestRectDemo(DrawImageEmulations example, CanvasControl sender)
 {
     fillPattern  = example.checkedFillPattern;
     sourceBitmap = example.tiger;
     sourceEffect = new HueRotationEffect()
     {
         Source = sourceBitmap,
         Angle  = 1
     };
 }
コード例 #2
0
            public OpacityDemo(DrawImageEmulations example, CanvasControl sender)
            {
                fillPattern         = example.checkedFillPattern;
                premultipliedSource = CreateSourceImage(sender, CanvasAlphaMode.Premultiplied);
                ignoreSource        = CreateSourceImage(sender, CanvasAlphaMode.Ignore);

                premultipliedTarget = new CanvasRenderTarget[2]
                {
                    CreateTarget(sender, CanvasAlphaMode.Premultiplied),
                    CreateTarget(sender, CanvasAlphaMode.Premultiplied)
                };

                ignoreTarget = new CanvasRenderTarget[2]
                {
                    CreateTarget(sender, CanvasAlphaMode.Ignore),
                    CreateTarget(sender, CanvasAlphaMode.Ignore)
                };
            }
コード例 #3
0
            public OffsetDemo(DrawImageEmulations example, CanvasControl sender)
            {
                fillPattern = example.checkedFillPattern;

                var rt = new CanvasRenderTarget(sender, (float)example.tiger.Size.Width, (float)example.tiger.Size.Height, sender.Dpi / 3);

                using (var ds = rt.CreateDrawingSession())
                {
                    ds.DrawImage(example.tiger, rt.Bounds);
                }
                sourceBitmap = rt;

                sourceEffect = new HueRotationEffect()
                {
                    Source = sourceBitmap,
                    Angle  = 1
                };

                showSourceRectRT = new CanvasRenderTarget(sender, (float)rt.Size.Width, (float)rt.Size.Height, rt.Dpi);
            }
コード例 #4
0
 public IDemo Create(DrawImageEmulations example, CanvasControl sender)
 {
     return (IDemo)Activator.CreateInstance(Type, example, sender);
 }
コード例 #5
0
            public OpacityDemo(DrawImageEmulations example, CanvasControl sender)
            {
                fillPattern = example.checkedFillPattern;
                premultipliedSource = CreateSourceImage(sender, CanvasAlphaMode.Premultiplied);
                ignoreSource = CreateSourceImage(sender, CanvasAlphaMode.Ignore);

                premultipliedTarget = new CanvasRenderTarget[2]
                {
                    CreateTarget(sender, CanvasAlphaMode.Premultiplied),
                    CreateTarget(sender, CanvasAlphaMode.Premultiplied)
                };

                ignoreTarget = new CanvasRenderTarget[2]
                {
                    CreateTarget(sender, CanvasAlphaMode.Ignore),
                    CreateTarget(sender, CanvasAlphaMode.Ignore)
                };
            }
コード例 #6
0
 public DestRectDemo(DrawImageEmulations example, CanvasControl sender)
 {
     fillPattern = example.checkedFillPattern;
     sourceBitmap = example.tiger;
     sourceEffect = new HueRotationEffect()
     {
         Source = sourceBitmap,
         Angle = 1
     };
 }
コード例 #7
0
            public OffsetDemo(DrawImageEmulations example, CanvasControl sender)
            {
                fillPattern = example.checkedFillPattern;

                var rt = new CanvasRenderTarget(sender, (float)example.tiger.Size.Width, (float)example.tiger.Size.Height, sender.Dpi / 3);
                using (var ds = rt.CreateDrawingSession())
                {
                    ds.DrawImage(example.tiger, rt.Bounds);
                }
                sourceBitmap = rt;

                sourceEffect = new HueRotationEffect()
                {
                    Source = sourceBitmap,
                    Angle = 1
                };

                showSourceRectRT = new CanvasRenderTarget(sender, (float)rt.Size.Width, (float)rt.Size.Height, rt.Dpi);
            }
コード例 #8
0
 public IDemo Create(DrawImageEmulations example, CanvasControl sender)
 {
     return((IDemo)Activator.CreateInstance(Type, example, sender));
 }