stroke

Overlapping Dashed / Dotted Strokes on Adjacent Paths in SVG

笑着哭i 提交于 2020-01-15 11:05:10
问题 I'm building a map of several counties that share borders. Each county is it's own enclosed path, and therefore the borders of adjacent counties are stacked over one another. I'd like to give each county a dashed stroke. However, when applied, the intersecting borders look ugly as the dashed borders of each county overlap, creating an uneven dash appearance. My users will be selecting counties by mousing over the area within the county borders, thus (I believe) making it necessary to create

Overlapping Dashed / Dotted Strokes on Adjacent Paths in SVG

六眼飞鱼酱① 提交于 2020-01-15 11:03:27
问题 I'm building a map of several counties that share borders. Each county is it's own enclosed path, and therefore the borders of adjacent counties are stacked over one another. I'd like to give each county a dashed stroke. However, when applied, the intersecting borders look ugly as the dashed borders of each county overlap, creating an uneven dash appearance. My users will be selecting counties by mousing over the area within the county borders, thus (I believe) making it necessary to create

OSMDroid PathOverlay drawing is corrupted at high zoom levels

有些话、适合烂在心里 提交于 2020-01-14 04:40:10
问题 I'm using OSMdroid to implement a mapping application. I have implemented a custom MapTileProvider that uses a tile source that allows zoom levels up to 22. The default MAPNIK provider only allows zooms to level 18. The problem is that any PathOverlay instances draw perfectly until zoom level 19, but then are not drawn properly at zoom level 20-22. it looks like someone's rubbed out the path with an eraser over 90% of the path length (see screenshots below). I've stepped through the draw()

Using XamlReader for controls that does not have a default constructor

╄→尐↘猪︶ㄣ 提交于 2020-01-11 09:57:12
问题 I have some string representations of Xaml objects, and I want to build the controls. I'm using the XamlReader.Parse function to do this. For a simple control such as Button that has a default constructor not taking any parameters this works fine: var buttonStr = "<Button xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">Text</Button>"; var button = (Button)XamlReader.Parse(buttonStr); However, when I try to do this to e.g. a Stroke control it fails. First trying a simple

Using XamlReader for controls that does not have a default constructor

依然范特西╮ 提交于 2020-01-11 09:57:04
问题 I have some string representations of Xaml objects, and I want to build the controls. I'm using the XamlReader.Parse function to do this. For a simple control such as Button that has a default constructor not taking any parameters this works fine: var buttonStr = "<Button xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">Text</Button>"; var button = (Button)XamlReader.Parse(buttonStr); However, when I try to do this to e.g. a Stroke control it fails. First trying a simple

Drawing a WPF shape, as a Rectangle: StrokeThickness halve if Stroke is Transparent

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-06 11:48:24
问题 the problem: I have some UCControl than design geometric shapes. I can configure at runtime, dimensions (size and stroke thickness), colours (background and stroke) and all work fine until I use solid colors. Problems happened if I use, for stroke, Transparent brush: the shape appears with correct dimensions and colours, but the strokethikness is halve. <Grid x:Name="_grid" > <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition

WPF/Silverlight: Is it possible to have a different stroke color for each edge?

不想你离开。 提交于 2020-01-06 03:41:26
问题 Say I have a rectangle with a certain stroke color. Can I define certain edges to have different colors? For example, say I want the top and bottom of the stroke to be one color, but the left and right of the stroke to be a different color? If this is not possible, do you know of a good way? 回答1: I ended up doing this by having two borders one on top of eachother. And I adjust the border thicknesses accordingly. 回答2: Not out of the box. Also unfortunately both Rectangle and Border are sealed

iOS SpriteKit How to make stroke color transparent?

空扰寡人 提交于 2020-01-03 03:21:11
问题 I do some simple games using SpriteKit now. There is one problem with stroke color in drawing process. I have to do my colored shapeNode transparent, but my stroke color stays the same every time. I've tried different techniques to do my node be entirely transparent: 1)setting alpha component to stroke color 2)setting alpha component to whole node. It didn't help. Is there is any way to achieve or get around this? Creation of my node CGMutablePathRef arc = CGPathCreateMutable(); cardWidth =

Linear gradient's bounds computation takes parent's bounds in account, not the node on which it is applied on

。_饼干妹妹 提交于 2019-12-31 04:23:05
问题 I want to put a linear gradient on a line(width wise ie across it's stroke width). This line is a child of a Group node. When I apply linear gradient on line, the color stops are calculated using Group's bounds not the lines bounds. In my code below, linear gradient will show up properly when added length-wise ie "to bottom", but not when added width wise, ie "to right". Can anyone tell me what can be work around for this? Here is the SSCCE import javafx.application.Application; import javafx

使用canvas 画钟表

狂风中的少年 提交于 2019-12-25 14:52:47
学习了一些关于canvas的知识后,自己捣鼓了一个时钟表。可能代码还可以更加优化,但是也还能实现 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>钟表</title> <style> /* canvas { border: 1px solid #000; } */ ul { list-style: none; } </style> </head> <body> <canvas id="mycanvas" width="800" height="600">您的浏览器不支持,请更换浏览器</canvas> <script> var mycanvas = document.getElementById('mycanvas') //获取上下文 var ctx = mycanvas.getContext('2d') //转换中心点 ctx.translate(mycanvas.width / 2, mycanvas.height / 2) //函数自调用