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
4
votes
4 answers

Something like SVG non-scaling-stroke in Android?

I have a Canvas that comes from a Picture beginRecording() method. I record things in the canvas and then call endRecording(). I would like to be able to record strokes that will not scale when the canvas is scaled afterwards. I cannot see…
mamuso
  • 3,117
  • 3
  • 30
  • 32
4
votes
1 answer

Openlayers: How to add a colored border around a line features

I want to assign a border to line feature. In the below code, I am able to assign stroke color as per the type of road but I want to assign another border on it. for e.g. I want to assign a border to the last else statement. whatever features fall…
poonam patel
  • 135
  • 13
4
votes
2 answers

Using CSS, how do you create a text stroke outline that is *thicker* than 1px?

Below is the code I was using to do a Text Stroke outline of 1px. But how do I get the outline thicker? If I just replace all "1px" with "5px", the result looks crazy. HTML
Hello!
CSS .element { color:white; …
m0a
  • 1,005
  • 2
  • 15
  • 29
4
votes
0 answers

Joint.js / Rappid - Hairline (1px) strokes for links and borders

I must be just missing it somewhere but how does one define a hairline stroke in Joint.js? My shapes and lines are not scaled and no matter what I do, everything seems to be rendered 2px anti-aliased. Here's my default link…
Buta
  • 73
  • 1
  • 4
4
votes
1 answer

Animate the stroke width of a Shape

I have a thick circle with a transparent centre:
4
votes
1 answer

Draw diagonal lines with Java

I have the following code: private _x,_y,_w,_h; protected void paintComponent( Graphics g_ ) { g_.setStroke( new BasicStroke(2) ); g_.drawLine(_x, _y, _x+_w, _y+_h); g_.drawLine(_x, _y+_h, _x+_w, _y); } In my case I'm drawing the diagonals…
gregseth
  • 12,952
  • 15
  • 63
  • 96
4
votes
1 answer

Android StateListDrawable pressed state always show last added

I have a custom button, and changed its pressed and default color by programmatically. public class CustomApplicationButton extends Button { public CustomApplicationButton(Context context) { this(context, 0, 0, 0); } public…
yasinkafadar
  • 229
  • 1
  • 12
4
votes
1 answer

Apply SVG filter to "fill" only

How do I apply an SVG filter on an SVG element, but not on its stroke? Let's say I have this SVG filter (it puts the red component to 100%):
Xenos
  • 3,351
  • 2
  • 27
  • 50
4
votes
2 answers

Smoothing a rounded stroke in Core Graphics

I am creating my own UITableViewCells with a gradient background. I have all the logic and drawing worked out, but one thing I want to fix is the "chunkiness" around the corners of my custom cell: alt text http://grab.by/27SM If you zoom in on the…
coneybeare
  • 33,113
  • 21
  • 131
  • 183
4
votes
1 answer

Android - Stroke looks pixelated at the corners of a rounded rectangle

Why is the stroke at the corners of the rectangle so ugly? If I draw the shape in xml, it works fine (at least it works in activities, I could not test it with a widget). Paint strokePaint = new Paint(); strokePaint.setARGB(255, 16, 23,…
erdomester
  • 11,789
  • 32
  • 132
  • 234
3
votes
3 answers

How can I make a SVG stroke show a background?

I have an SVG with a gradient-like background and a foreground icon. Currently, the icon is just one filled path with polylines on top, but it can be instead split into multiple paths where the polyline would be the stroke. However, I want to,…
hopperelec
  • 133
  • 1
  • 2
  • 13
3
votes
1 answer

Button Stroke Set Gap In specific position Swiftui

I have added the borders for all sides using code below in SwiftUI. I want to trim stroke a particular position like below. Want to achieve:- Output:- Code:- import SwiftUI struct RoundTrimImage: View { var body: some View { VStack{ …
Sham Dhiman
  • 1,348
  • 1
  • 21
  • 59
3
votes
1 answer

MaterialCardView change background color and stroke color programmatically

Pro devs. I'll try to change the card view background and stroke color programmatically but all times card.setCardBackgroundColor() override the stroke color. Statically in XML, it works well. But programmatically it make an effect like this. val…
billy gates
  • 188
  • 3
  • 16
3
votes
1 answer

p5.js webgl polygon line joints workaround?

About custom shapes (using beginShape function) with a stroke in p5.js WEBGL Mode: In WEBGL Mode the lineJoint() and lineCap() functions are not available. This is why the lines in a shape don't connect seamlessly. I tried to work around the problem…
Sebe
  • 51
  • 4
3
votes
1 answer

Stroke for Custom Image in Fabric JS

I'm trying to create stroke around images I've added to canvas using Fabric JS. The stroke I've added to a PNG with transparent background looked like this: Although I'm trying to create stroke "around" the image and stick the stroke to the edges…
platypus
  • 706
  • 2
  • 18
  • 40