Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
noahnu
Posts: 138
Registered: ‎01-09-2011
My Device: Blackberry Tablet OS
Accepted Solution

graphics.lineStyle Thickness to pixels?

Hello, in the adobe documentation for ActionScript 3.0 the thickness parameter of flash.display.graphics.lineStyle is defined as:

 

"An integer that indicates the thickness of the line in points; "

 

How many pixels are in one point? Basically I need to know how many pixels a line created with a certain thickness will take up.

From,
Noah NU
Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: graphics.lineStyle Thickness to pixels?

hey noah,

 

contrary to what the description says, i think the value is actually in pixels. from the times i've used it, eyeballing it looks like its in pixels.

 

here is an excerpt from a page on adobe.com where they show an example of its use. they also refer it to as a pixel value:

 

"... For example, this line of code tells the Shape named myShape to draw lines that are 2 pixels thick, red (0x990000), and 75% opaque: ..."

 

and the code example:

 

 

myShape.graphics.lineStyle(2, 0x990000, .75);

 

 

here is the page:

 

http://livedocs.adobe.com/flex/3/html/help.html?content=Drawing_Vector_Graphics_4.html

 

hope that helps. good luck!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Please use plain text.
Developer
noahnu
Posts: 138
Registered: ‎01-09-2011
My Device: Blackberry Tablet OS

Re: graphics.lineStyle Thickness to pixels?

Thanks, this solved a few issues I had with my application.

From,
Noah NU
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: graphics.lineStyle Thickness to pixels?

In case you do encounter point as a measurement unit (generally in typography), note that it's now defined as 1/72 of an inch (0.0139"), or 0.3528mm.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
jffurlan
Posts: 1,003
Registered: ‎01-16-2011
My Device: PlayBook (sim)
My Carrier: Rogers

Re: graphics.lineStyle Thickness to pixels?

Kudo for JRab - I couldn't figure out why when I set an opaque background to 1 or 100 it didn't change. It never clued in to me that it's a percentage and needs to be between 0 and 1.

- If you like my response/post, or it helped you find an answer you were looking for, please provide a Kudo - white star to the bottom right of this post. -
- Please use the search bar at the top, or check out the PlayBook FAQ's for help getting started -
- Hockey DrillBook -
Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: graphics.lineStyle Thickness to pixels?

hey jffurian,

 

in most places where they require an alpha value (percentage), its usually a decimal less than or equal to 1. it has stumped me and others in the past im sure. its common mistake so no worries. thanks for the kudo. glad i could help!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Please use plain text.