Exemplo n.º 1
0
        public void Render()
        {
            ////////////////////////////////////
            HostDC.EndDraw();

            using (D2DBitmap loadBp = new D2DBitmap(HostDC, Size,
                                                    new BitmapProperties1(HostDC.PixelFormat, HostDC.DotsPerInch.Width, HostDC.DotsPerInch.Height, BitmapOptions.Target | BitmapOptions.CannotDraw)), loadBp2 = new D2DBitmap(HostDC, Size,
                                                                                                                                                                                                                              new BitmapProperties1(HostDC.PixelFormat, HostDC.DotsPerInch.Width, HostDC.DotsPerInch.Height, BitmapOptions.None)))
            {
                var old_target = HostDC.Target;


                HostDC.Target = loadBp;

                HostDC.BeginDraw();
                HostDC.Clear(Color);
                var RCP = RenderGroup.ToArray();
                foreach (var i in RCP)
                {
                    i?.Render();
                }

                HostDC.EndDraw();

                if (Effecting != null)
                {
                    loadBp2.CopyFromBitmap(loadBp);
                    var resultEff = Effecting(loadBp2, HostDC);

                    if (resultEff == null)
                    {
                        Effecting = null;
                        goto tag;
                    }
                    var resultIm = resultEff.Output;
                    HostDC.BeginDraw();
                    HostDC.Clear(Color);
                    HostDC.DrawImage(resultIm, new RawVector2(0, 0), null, SharpDX.Direct2D1.InterpolationMode.Linear, CompositeMode.SourceOver);
                    HostDC.EndDraw();
                    resultEff.Dispose();
                    resultIm.Dispose();
                }
tag:
                loadBp2.CopyFromBitmap(loadBp);
                HostDC.Target = old_target;
                HostDC.BeginDraw();

                if (old_target as D2DBitmap == null)
                {
                    old_target.Dispose();
                }

                if (Effecting != null)
                {
                }

                HostDC.DrawBitmap(loadBp2, OutPutRange, 1f, SharpDX.Direct2D1.InterpolationMode.Linear, Range, null);
            }
        }
Exemplo n.º 2
0
 public override void Render()
 {
     if (Source.Updated)
     {
         _Pelete?.Dispose();
         _Pelete = Source.Output;
     }
     using (Image PrepairedImage = Output(HostDC))
         HostDC.DrawImage(PrepairedImage, new RawVector2(_Position.X, _Position.Y), null, SharpDX.Direct2D1.InterpolationMode.Linear, CompositeMode.SourceOver);
 }
Exemplo n.º 3
0
        public override void Render()
        {
            using (SolidColorBrush BorderBrush = new SolidColorBrush(HostDC, Border), FillerBrush = new SolidColorBrush(HostDC, Filler))
            {
                for (int i = 0; i < Path.Length - 1; i++)
                {
                    var area = new Mesh(HostDC, new Triangle[] { new Triangle()
                                                                 {
                                                                     Point1 = new RawVector2(Path[0].X, Path[0].Y), Point2 = new RawVector2(Path[i].X, Path[i].Y), Point3 = new RawVector2(Path[i + 1].X, Path[i + 1].Y)
                                                                 } });

                    HostDC.FillMesh(area, FillerBrush);
                    HostDC.DrawLine(new RawVector2(Path[i].X, Path[i].Y), new RawVector2(Path[i + 1].X, Path[i + 1].Y), BorderBrush, Thickness);
                    area.Dispose();
                }
                HostDC.DrawLine(new RawVector2(Path[Path.Length - 1].X, Path[Path.Length - 1].Y), new RawVector2(Path[0].X, Path[0].Y), BorderBrush, Thickness);
            }
        }
Exemplo n.º 4
0
 public override void Render()
 {
     using (SolidColorBrush brush = new SharpDX.Direct2D1.SolidColorBrush(HostDC, Color))
         HostDC.DrawText(this.text, wformat, Range, brush);
 }
Exemplo n.º 5
0
 public override void Render()
 {
     HostDC.DrawLine(new RawVector2(Position.X, Position.Y - 1.5f), new RawVector2(Position.X + PixelLong, Position.Y - 1.5f), br, 3);
     using (SolidColorBrush b = new SolidColorBrush(HostDC, new RawColor4(0.85f, 0.85f, 0.85f, 1)))
         HostDC.FillEllipse(new Ellipse(new RawVector2((float)(Position.X + PixelLong * Process), Position.Y - 2f), 4, 4), b);
 }