Questions tagged [stroke]

a line drawn along a path

On iOS, this might be a UIBezierPath or on Android, this would be a collection of attributes describing the line in XML (such as width, color, width and gap).

476 questions
7
votes
4 answers

Using SVG filter to create an inside stroke

I would like to simulate and "inside stroke" on an svg path. I have an svg map with multiple complex paths (countries) each with a different fill color stroke. And i would like to add a "fake inside stroke" in the first one. I managed to get a few…
Flunch
  • 816
  • 5
  • 17
7
votes
4 answers

Dotted line separator with custom thickness

I have a dotted line separator
Vihaan Verma
  • 12,815
  • 19
  • 97
  • 126
7
votes
1 answer

How to prevent ugly spikes in canvas font rendering?

When I draw text in canvas, I get ugly spikes, like this: Try it here: http://jsfiddle.net/48m4B/ While for example in photoshop, I get this: The code is just a classic strokeText: ctx.font = '20px Arial'; ctx.lineWidth = 15; ctx.strokeStyle =…
psycho brm
  • 7,494
  • 1
  • 43
  • 42
7
votes
1 answer

How to draw a path with variable stroke width

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.…
Dave
  • 79
  • 1
  • 3
7
votes
2 answers

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

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…
OWolf
  • 5,012
  • 15
  • 58
  • 93
6
votes
2 answers

Circle with an evenly dotted border in SwiftUI?

I'm trying to create a resizable button that has an evenly dotted circle border around it. If you simply put: Circle() .stroke(color, style: StrokeStyle(lineWidth: 3, lineCap: .butt, dash: [3, radius / 3.82])) .frame(width: radius * 2, height:…
danylo.net
  • 253
  • 3
  • 7
6
votes
1 answer

Why does a CSS svg have a thicker stroke on the right and bottom sides?

I've created a few svg-based icons for a small website I'm working on but I'm having trouble getting the stroke to look how I'd like. If you look at this jsfiddle you can see my issue. The stroke for the outer is 1px all the way around but…
poncho
  • 1,100
  • 2
  • 15
  • 38
6
votes
3 answers

SwiftUI Stroke Colour and Width?

I am following Apples "Creating and Combining View" SwiftUI Tutorial and on Section 4 Step 5 I am asked to add a Gray Stroke, which I can do but doesn't show the colour or give me a line width. .clipShape(Circle()) .overlay( …
SD449
  • 97
  • 1
  • 7
6
votes
1 answer

Zero stroke-width in SVG

Having used Postscript for years, I am now learning SVG. There is a feature of PS that I have not been able to replicate so far: zero-width lines. In PS, a line with zero width is always visible: PostScript converts zero line width to the smallest…
zeycus
  • 860
  • 1
  • 8
  • 20
6
votes
1 answer

Make canvas fill include stroke in shapes

Ok, so i am making a 3D rendering engine in pure javascript, as a challenge of course - to test my linear algebra skills. I am not using webgl, so please do not say "use webgl". Anyways, the software will take in triangles, a camera and local…
notrota
  • 1,048
  • 10
  • 21
6
votes
1 answer

Drawing on WriteableBitmap

I have a WriteableBitmap and would like the user to be able to draw over it as if it was an InkPresenter control. What is the best way to go about doing this in realtime? Using WriteableBitmap.Pixels, I'm able to access each pixel, but when I try to…
Brap
  • 2,647
  • 2
  • 19
  • 15
6
votes
1 answer

Double line stroke in html5 canvas

I want to draw a shape that has a double line border using html5 canvas path. The default stroke (context.stroke()) has a single line type of path. I can draw a similar shape inside an original shape to generate a figure that looks like a one made…
Dangila
  • 1,434
  • 3
  • 14
  • 25
6
votes
1 answer

HTML5 Canvas stroke not anti-aliased

I'm just trying to make a circle with a thick anti-aliased stroke in canvas. The circle gets drawn as expected, but the edges of the stroke are very jaggy. I keep reading that Chrome forces anti-aliasing, so not sure what to do... Fiddle:…
nipponese
  • 2,813
  • 6
  • 35
  • 51
6
votes
4 answers

iOS Brush Hardness like Photoshop

How to get the following brush smoothness(hardness) effect like photoshop? My attempt: CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSaveGState(context); CGContextSetLineCap(context,…
Jun
  • 3,422
  • 3
  • 28
  • 58
5
votes
2 answers

How to make pencil stroke for iPhone app?

I would like to make a pencil stroke in an iPhone application, which can draw lines such as you can see in this picture: Can anybody show me how I could implement these types of stroke?
Mashhadi
  • 3,004
  • 3
  • 46
  • 80
1 2
3
31 32