mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2010
Posts: 4
S
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Aug 2010
Posts: 4
NOTE: PROBLEM FIXED. SEE LAST ENTRY

To whom it may concern, which is just about anyone on here...

I wish to draw a part of a circle, but not a whole circle onto a custom picwin window. As far as I can see.. using Drawrect -e allows me to draw a circle/ellipse, but i cannot see where i can draw a section of it rather than a full circle/ellipse.

I must be missing something here,

can anyone share/discuss on how to achieve this?

Thanks in advance,
Sparty

Last edited by Spartanis; 08/08/10 04:44 AM.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Probably the easiest solution would be to draw the full circle, then cover the half you don't want with a filled rectangle the color of your background.


Invision Support
#Invision on irc.irchighway.net
Joined: Aug 2010
Posts: 4
S
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Aug 2010
Posts: 4
Riamus2,

I have thought of that initially, and now that you have confirm the idea, i went ahead to do that.

Maybe my maths isnt good but I have a new problem (lol gawd)

See red circle area:



As you can see, the hilight drawrect -d still remain visable after drawing the ellipse and covering unwanted areas with rectangle fills.

The following are the code (excuse basic coding, i always start basic before ii "clean up" into more complex coding.. its easier this way for me to keep track of everything smile )

The Code:


window -adk0opx +f @SME_MENU -1 -1
/drawfill -r $active $rgb(150,100,150) 0 1 1

/drawrect -rfd $active $rgb(100,100,100) 2 100 100 300 400 50 26
/drawrect -rd $active $rgb(0) 1 100 100 300 400 50 26
/drawrect -rd $active $rgb(200,200,200) 1 101 101 298 398 50 26

/drawline -r $active $rgb(50,50,50) 1 125 498 375 498
/drawline -r $active $rgb(50,50,50) 1 398 112 398 488

/drawrect -re $active $rgb(50,50,50) 1 349 473 50 26

/drawrect -rf $active $rgb(100,100,100) 1 345 470 34 28
/drawrect -rf $active $rgb(100,100,100) 1 379 470 19 14

Joined: Aug 2010
Posts: 4
S
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Aug 2010
Posts: 4
Problem Fixed.

I did a little bit of thinking and exploring .. and i come up with a suitable if not fantastic solution to that dotty area as mentioned above.

Instead of drawing an ellipse shadow and covering unwanted areas, I drew a filled rectangle and then fill the outside area to COVER the unwanted part of the rectangle.

[b]Pseudo code:[/b]

Create Window.
draw Fill the background of the window with shadow colour
Draw Rounded Filled Box (Dialog Background)
Draw Rounded Hilight box (Dialog Hilight lines)
Draw Shadow Lines for bottom and right side of Dialog
Draw Shadow filled rectangle over bottom right corner to cover Hilight rounded corner
Draw Rounded Border Box
Draw Fill the background of the window with desired colour

Mirc Script Code:

alias SME_MENU {
window -adk0opx +f @SME_MENU -1 -1

var %screen.w = $window($active).w
var %panel.w = 300
var %panel.x = $calc((%screen.w / 2) - (%panel.w / 2))

var %screen.h = $window($active).h
var %panel.h = 400
var %panel.y = $calc((%screen.h / 2) - (%panel.h / 2))

var %ex = 50
var %ey = 26

drawfill -r $active $dlgcol(dsh) 0 1 1

drawrect -rfd $active $dlgcol(dbg) 1 %panel.x %panel.y %panel.w %panel.h %ex %ey
drawrect -rd $active $dlgcol(dhl) 1 $calc(%panel.x + 1) $calc(%panel.y + 1) $calc(%panel.w - 2) $calc(%panel.h - 2) %ex %ey

drawline -r $active $dlgcol(dsh) 1 $calc(%panel.x + (%ex / 2)) $calc(%panel.y + %panel.h - 2) $calc((%panel.x + %panel.w) - (%ex / 2)) $calc(%panel.y + %panel.h - 2)
drawline -r $active $dlgcol(dsh) 1 $calc(%panel.x + %panel.w - 2) $calc(%panel.y + (%ey / 2)) $calc(%panel.x + %panel.w - 2) $calc((%panel.y + %panel.h) - (%ey / 2))

drawrect -rfd $active $dlgcol(dsh) 1 $calc(((%panel.x + %panel.w) - %ex) - 1) $calc(((%panel.y + %panel.h) - %ey) - 1) %ex %ey
drawrect -ref $active $dlgcol(dbg) 1 $calc(((%panel.x + %panel.w) - %ex) - 2) $calc(((%panel.y + %panel.h) - %ey) - 2) %ex %ey

drawrect -rf $active $dlgcol(dbg) 1 $calc((%panel.x + %panel.w) - %ex - 1) $calc((%panel.y + %panel.h - 1) - %ey) $calc(%ex / 2) $calc(%ey - 1)
drawrect -rf $active $dlgcol(dbg) 1 $calc((%panel.x + %panel.w) - %ex - 1) $calc((%panel.y + %panel.h) - %ey - 1) $calc(%ex - 1) $calc(%ey / 2)

drawrect -rd $active $dlgcol(dbr) 1 %panel.x %panel.y %panel.w %panel.h %ex %ey
drawfill -r $active $dlgcol(bg) $dlgcol(dbr) $calc(%panel.x + %panel.w - 3) $calc(%panel.y + %panel.h - 3)
}

Result:



Link Copied to Clipboard