Recent

Author Topic: LAMW: jDrawingView.PaintStrokeWidth has no effect, help please...  (Read 3121 times)

Manlio

  • Full Member
  • ***
  • Posts: 164
  • Pascal dev
LAMW: jDrawingView.PaintStrokeWidth has no effect, help please...
« on: September 26, 2019, 12:50:41 pm »
I'm trying to draw simple lines and paths on a jDrawingView, but the property PaintStrokeWidth seems to have no effect.

For example:

    jDrawingView.PaintColor := colbrBlue;
    jDrawingView.PaintStyle := psStroke;
    jDrawingView.PaintStrokeWidth := 1; // I tried 0, 0.1, 0.5, 1, 2, 3, 10, etc. -- no difference!
    jDrawingView.DrawLine(10,10, 200, 10);  // draw a horizontal line

No matter what PaintStrokeWidth value I use, the result is always the same: a single pixel line. Google calls it "hairline", which, according to the documentation, corresponds to Width = 0. (See link below for documentation)

Am I missing something?  Any help is most appreciated!

Here is the documentation page:

https://developer.android.com/reference/android/graphics/Paint.html?hl=idhttps%3A%2F%2Fdeveloper.android.com%2Fguide%2Ftopics%2Fui%2Fdialogs.html%3Fhl%3Didhttps%3A%2F%2Fdeveloper.android.com%2Fguide%2Ftopics%2Fui%2Fnotifiers%2Fnotifications.htmlhttps%3A%2F%2Fwww.twoh.co%2F2017%2F01%2F07%2Ftutorial-cara-membuat-alert-dialog-sederhana-di-android%2F#setStrokeWidth(float)
manlio mazzon gmail

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: LAMW: jDrawingView.PaintStrokeWidth has no effect, help please...
« Reply #1 on: September 26, 2019, 06:24:51 pm »

Quote
jDrawingView.PaintStrokeWidth := 1; // I tried 0, 0.1, 0.5, 1, 2, 3, 10, etc. -- no difference!

Maybe some bug....

I will do some test....

Thank you!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: LAMW: jDrawingView.PaintStrokeWidth has no effect, help please...
« Reply #2 on: September 29, 2019, 04:31:31 am »

Fixed!!!

["jDrawingView.java"]


Thank you!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Manlio

  • Full Member
  • ***
  • Posts: 164
  • Pascal dev
Re: LAMW: jDrawingView.PaintStrokeWidth has no effect, help please...
« Reply #3 on: September 29, 2019, 09:12:21 pm »
I just tried it and now it works perfectly.

:)

Thank you!!
manlio mazzon gmail

 

TinyPortal © 2005-2018