Ejemplo n.º 1
0
        protected override void createResources(IRenderDevice rd)
        {
            var          dd = context.drawDevice;
            sStrokeStyle ss = new sStrokeStyle()
            {
                lineJoin   = pathLineJoin,
                miterLimit = 2,
                startCap   = lineCaps,
                endCap     = lineCaps,
            };

            strokeStyle = dd.createStrokeStyle(ss);

            onResized(dd.viewportSize, context.dpiScalingFactor);
            dd.resized.add(this, onResized);
            brushes = brushColors.Select(dd.createSolidBrush).ToArray();
            if (playAnimation)
            {
                context.animation.startDelta(this);
            }
        }
Ejemplo n.º 2
0
 void iDrawContext.drawGeometry(iGeometry geometry, iBrush brush, float width, iStrokeStyle strokeStyle)
 {
     switch (brush)
     {
     case SolidColorBrush solidColor:
         var          cd = solidColor.data;
         sStrokeStyle ss = strokeStyle?.strokeStyle ?? defaultStrokeStyle();
         strokeGeometry((iPathGeometry)geometry, cd, null, width, ref ss);
         return;
     }
     throw new NotImplementedException();
 }
Ejemplo n.º 3
0
        void iDrawContext.fillAndStroke(iGeometry geometry, iBrush fill, iBrush stroke, float strokeWidth, iStrokeStyle strokeStyle)
        {
            sStrokeStyle  ss   = strokeStyle?.strokeStyle ?? defaultStrokeStyle();
            iPathGeometry path = (iPathGeometry)geometry;

            fillAndStrokeGeometry(path, fill.data(), stroke.data(), strokeWidth, ref ss);
        }