stroke

Dotted line separator with custom thickness

妖精的绣舞 提交于 2019-12-05 00:33:43
问题 I have a dotted line separator <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line"> <!-- #17b851 #C7B299 --> <stroke android:color="#9e9c85" android:dashWidth="10px" android:dashGap="10px" /> </shape> Right now its barely visible. How can I make it thick . I tried giving android:height="2px" & android:dashHeight="5px" but it didnt work. 回答1: You can use stroke width, android:width="3dp" snapshot 回答2: Stroke WIDTH must

Partial border/stroke using SVG

随声附和 提交于 2019-12-04 16:57:32
I'm using svg/d3 for creating a chart made of 'rect' elements. What is the best way for adding a partical border/stroke for each rectangle (only on top of the rectangle)? Thanks I don't think SVG supports stroking only portions of a rectangle or path - stroke isn't like a CSS border. You're left with a few other options, all of which take some extra work: Stroke the entire rect and apply a clipPath to remove the other three edges - probably works best if you make the rectangles bigger than necessary. Apply a linear gradient fill to each rect, using the gradient definition to show a "border" at

How to draw a path with variable stroke width

风格不统一 提交于 2019-12-04 08:44:07
问题 My code is basically from this example (http://corner.squareup.com/2010/07/smooth-signatures.html) and Google APIs (FingerPaint) but now I want to use the class VelocityTracker in order to change the stroke width depending on the speed of my finger. I thought I could split a path into smaller parts but I didn't find any examples. There's also this second post (http://corner.squareup.com/2012/07/smoother-signatures.html) but I do neither have a specific bezier curve class nor do I collect all

UIView drawRect: is it possible to stroke inside a path?

情到浓时终转凉″ 提交于 2019-12-04 04:15:37
With core graphics, is it possible to stroke the inside of a path? As opposed to the line weight being drawn half on the outside and half on the inside of a stroked path? The reason being it would be easier to control the visible thickness of the stroke if say part of a view is on the screen edge and part is not. The part on the screen edge gets cut off, while the view edge that is fully on screen looks thicker (as both sides if the stroke are visible). Clip to the path before you stroke it. This draws no stroke: - (void)drawRect:(CGRect)rect { CGContextRef context =

Dotted line separator with custom thickness

柔情痞子 提交于 2019-12-03 15:46:10
I have a dotted line separator <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line"> <!-- #17b851 #C7B299 --> <stroke android:color="#9e9c85" android:dashWidth="10px" android:dashGap="10px" /> </shape> Right now its barely visible. How can I make it thick . I tried giving android:height="2px" & android:dashHeight="5px" but it didnt work. Raghunandan You can use stroke width, android:width="3dp" snapshot Stroke WIDTH must be smaller than the size HEIGHT. (Stroke width is the width of the line. Size height is the height of

Transparency of a filled stroke in HTML5

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 13:01:47
问题 I'm working on a doodling app in HTML5 and I would like to do a sort of bucket feature. The idea is to draw a path and it will be closed and filled with the selected colour (colour of the stroke). It works quite well with solid colours, but if I want to have a transparent stroke and fill, I run into this problem: http://imgur.com/0N3MW What happens is the fill is done until the middle of the stroke (the actual sampling point of the path) so there's a line of half the size of the stroke inside

How to draw a path with variable stroke width

蹲街弑〆低调 提交于 2019-12-03 00:42:47
My code is basically from this example ( http://corner.squareup.com/2010/07/smooth-signatures.html ) and Google APIs (FingerPaint) but now I want to use the class VelocityTracker in order to change the stroke width depending on the speed of my finger. I thought I could split a path into smaller parts but I didn't find any examples. There's also this second post ( http://corner.squareup.com/2012/07/smoother-signatures.html ) but I do neither have a specific bezier curve class nor do I collect all the points in an ArrayList so their example for adjusting stroke width is not very helpful. Does

How do I fill/stroke an SVG file on my website?

帅比萌擦擦* 提交于 2019-12-02 19:29:28
问题 I Googled this issue for about 30 minutes and was surprised nobody has asked so maybe it's not possible. I'm using this line to embed the SVG file that I made in AI (note that when I saved the SVG, I had no fill OR stroke on the paths): <object type="image/svg+xml" data="example.svg" height=600px width=600px>Your browser does not support SVG</object> This obviously comes up with no image because the SVG file has no fill or stroke. I tried adding in ...fill=yellow> or ...style="fill:yellow;">

Why is SVG stroke-width : 1 making lines transparent?

流过昼夜 提交于 2019-12-02 16:17:06
I'm creating stock charts with svg and I'm having a problem when I set the stroke-width of my path elements to 1. Instead of making the lines more narrow, it just makes it the same size as stroke-width:2 but slightly transparent. I can't post an image of it though because I don't have enough reputation points... My svg tag looks like so: <div style="height:300px; width:400px; overflow:hidden"> <svg style="position:relative" height="10000" width="10000" version="1.1" xmlns="http://www.w3.org/2000/svg"> </svg> </div> And I'm adding path elements dynamically using javascript/jquery: var shape =

How do I fill/stroke an SVG file on my website?

梦想与她 提交于 2019-12-02 08:23:45
I Googled this issue for about 30 minutes and was surprised nobody has asked so maybe it's not possible. I'm using this line to embed the SVG file that I made in AI (note that when I saved the SVG, I had no fill OR stroke on the paths): <object type="image/svg+xml" data="example.svg" height=600px width=600px>Your browser does not support SVG</object> This obviously comes up with no image because the SVG file has no fill or stroke. I tried adding in ...fill=yellow> or ...style="fill:yellow;"> but I'm not having any luck. Thanks! Have a nice trick: Embed it as <img> and use javascript to convert