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); } }
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(); }
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); }