Page 1 of 1

Drawing oblique lines

Posted: April 29th, 2011, 4:50 pm
by Jarhead
Hi there.
I use the IMAGE meter to draw horizontal or vertical lines. Hell, I can also use the ROUNLINE meter to draw circular lines. But I can't manage to draw an oblique line. Is there a way?

Re: Drawing oblique lines

Posted: April 30th, 2011, 10:53 pm
by Falconer
You mean at some angle that is not a multiple of 90 degrees?

You could try this, but it is a bit of a pain, and I would just use an IMAGE meter with a .png...
(Note that I have not tested this; it's just theory...)

You want a Measure that will always be equal to one, to draw a solid, unmoving line with with roundline. For instance:

Code: Select all

[measureAlways1]
Measure=FreeDiskSpace
Drive=C:
Total=1
MaxValue=1
MinValue=0
UpdateDivider=86400
Then you would use a ROUNDLINE meter like this:

Code: Select all

[meterLine]
Meter=ROUNDLINE
MeasureName=measureAlways1
X=0 <- wherever you want it
Y=0
StartAngle=4.712  <- the angle you want it at in Rad
RotationAngle=4.712
LineWidth=2 <- However thick you want it
LineStart=0
LineLength=60 <- however long you want it
LineColor=255,255,255
Solid=1 <- I'm not sure if this even matters, since the line won't move...
AntiAlias=1
That should, in theory, work. The meter should just draw a line starting at the X/Y, outward "LineLength" at the angle given in "Start/RotationAngle." This method would, however, be extremely tedious depending on what you used it for.

Re: Drawing oblique lines

Posted: May 1st, 2011, 2:50 am
by santa_ryan
thats one way falc... but not very good :/

ImageRotate
Rotates an image by the defined number of degrees. Negative numbers rotate counter-clockwise.

Thats what you want to use on images to rotate them. Its in degrees

Re: Drawing oblique lines

Posted: May 1st, 2011, 8:25 pm
by Falconer
santa_ryan wrote:thats one way falc... but not very good :/

ImageRotate
Rotates an image by the defined number of degrees. Negative numbers rotate counter-clockwise.

Thats what you want to use on images to rotate them. Its in degrees
You've got me there. :) Hey, I said it was a pain of a method... it's just what came to mind.
ImageRotate is definitely a way better idea!

Re: Drawing oblique lines

Posted: May 2nd, 2011, 2:58 pm
by Jarhead
Oooh the roundline method could have actually worked well, but I believe imagerotate it's actually quicker :P Thanks both!
But is it right that my code still gives me a completely vertical line?

Code: Select all

[MeterExtLine]
Meter=Image
ImageRotate=45
X=10
Y=20
H=40
W=12
SolidColor=#Color1#

Re: Drawing oblique lines

Posted: May 2nd, 2011, 7:23 pm
by smurfier
I believe that ImageRotate only works on an actual image, by which I mean displaying an image file, not the background or container which is what gets colored by using SolidColor. Your best bet is to use the roundline method described above.

Re: Drawing oblique lines

Posted: May 2nd, 2011, 7:54 pm
by santa_ryan
Now that i think about it smurfier your correct

Use the roundline method.

Re: Drawing oblique lines

Posted: May 3rd, 2011, 8:58 pm
by Jarhead
Mmh.. Actually maybe just using a .png just got more alluring... I'm making a vertical line and reusing it for all my needs maybe!

Re: Drawing oblique lines

Posted: May 3rd, 2011, 9:51 pm
by santa_ryan
just make a 10x10 white square, save it as a png, then use ImageTint and ImageRotate as you see fit.