Ejemplo n.º 1
0
 public DestRectDemo(DrawImageEmulations example, CanvasControl sender)
 {
     fillPattern  = example.checkedFillPattern;
     sourceBitmap = example.tiger;
     sourceEffect = new HueRotationEffect()
     {
         Source = sourceBitmap,
         Angle  = 1
     };
 }
Ejemplo n.º 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)
                };
            }
Ejemplo n.º 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);
            }
Ejemplo n.º 4
0
 public IDemo Create(DrawImageEmulations example, CanvasControl sender)
 {
     return (IDemo)Activator.CreateInstance(Type, example, sender);
 }
Ejemplo n.º 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)
                };
            }
Ejemplo n.º 6
0
 public DestRectDemo(DrawImageEmulations example, CanvasControl sender)
 {
     fillPattern = example.checkedFillPattern;
     sourceBitmap = example.tiger;
     sourceEffect = new HueRotationEffect()
     {
         Source = sourceBitmap,
         Angle = 1
     };
 }
Ejemplo n.º 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);
            }
Ejemplo n.º 8
0
 public IDemo Create(DrawImageEmulations example, CanvasControl sender)
 {
     return((IDemo)Activator.CreateInstance(Type, example, sender));
 }