Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetLineWidth , How to change only the height of the line instead of its width #196

Open
FxStar opened this issue Jan 4, 2024 · 0 comments

Comments

@FxStar
Copy link

FxStar commented Jan 4, 2024

SetLineWidth is proportionally scaled,

How to change only the height of the line instead of its width

For example, the image at the bottom

func TestAA(t *testing.T) {

	dc := gg.NewContext(1000, 1000)
	dc.SetRGB(1, 1, 1)
	dc.Clear()
	dc.SetRGB(0, 0, 0)
	w := 0.1
	for i := 100; i <= 900; i += 20 {
		x := float64(i)
		dc.DrawLine(x+50, 0, x-50, 1000)
		dc.SetLineWidth(w)

		dc.SetDash(2, 8, 8, 16)

		dc.Stroke()
		w += 0.2
	}
	dc.SavePNG("out11.png")
}

out11

1c7601a01ef9ac88b50ecccc142736f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant