It is currently March 28th, 2024, 6:42 pm

Drawing oblique lines

Get help with creating, editing & fixing problems with skins
Post Reply
Jarhead
Posts: 28
Joined: April 7th, 2011, 7:20 pm

Drawing oblique lines

Post 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?
User avatar
Falconer
Posts: 115
Joined: August 12th, 2009, 4:10 pm
Location: Behind you!

Re: Drawing oblique lines

Post 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.
User avatar
santa_ryan
Posts: 397
Joined: June 22nd, 2010, 4:11 am

Re: Drawing oblique lines

Post 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
User avatar
Falconer
Posts: 115
Joined: August 12th, 2009, 4:10 pm
Location: Behind you!

Re: Drawing oblique lines

Post 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!
Jarhead
Posts: 28
Joined: April 7th, 2011, 7:20 pm

Re: Drawing oblique lines

Post 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#
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Drawing oblique lines

Post 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.
User avatar
santa_ryan
Posts: 397
Joined: June 22nd, 2010, 4:11 am

Re: Drawing oblique lines

Post by santa_ryan »

Now that i think about it smurfier your correct

Use the roundline method.
Jarhead
Posts: 28
Joined: April 7th, 2011, 7:20 pm

Re: Drawing oblique lines

Post 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!
User avatar
santa_ryan
Posts: 397
Joined: June 22nd, 2010, 4:11 am

Re: Drawing oblique lines

Post by santa_ryan »

just make a 10x10 white square, save it as a png, then use ImageTint and ImageRotate as you see fit.
Post Reply