RECT_P but without filling - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: RECT_P but without filling (/thread-5226.html) |
RECT_P but without filling - hpfx - 11-27-2015 01:35 PM Hi, I tried to draw a rectangle, but without filling a color. I didn't use the fillColor parameters but it fill with border color. Code:
is there a tips for that ? Thank you. RE: RECT_P but without filling - DrD - 11-27-2015 02:46 PM Code:
RE: RECT_P but without filling - primer - 11-27-2015 03:18 PM Hi, (11-27-2015 02:46 PM)DrD Wrote: RECT_P(G0,130,90,190,110,#DDDDDDh,#FFFFFFFFh); // Rectangle, no fillIt's not exactly "no fill", but "white filled." For real "no fill", better to start on something like that : Code: RECT_P_NOFILL(x,y,x2,y2,col) RE: RECT_P but without filling - Tim Wessman - 11-27-2015 11:26 PM (11-27-2015 03:18 PM)primer Wrote: Hi, Yes, it is "no fill". Specifically, a fill a a maximum alpha value. For more clarity: RECT_P(10,10,50,50,RGB(35,45,55),RGB(0,0,0,255)); //fill will be completely transparent due to the last optional 4th alpha argument No need for a custom function here. RE: RECT_P but without filling - primer - 11-30-2015 09:04 AM Indeed, I was wrong at counting the number of "F" but with RGB(0,0,0,255) (#FF000000h) it's clear, thanks. helpfull tips ! Thanks. RE: RECT_P but without filling - eried - 11-30-2015 03:33 PM Both functions take almost the same time :O Code: RECT_P_NOFILL(x,y,x2,y2,col) RE: RECT_P but without filling - Thomas_Sch - 11-30-2015 06:08 PM Hello eried, your code is calling RECT_P_NO2FILL 2 times. Or are I'm wrong? RE: RECT_P but without filling - eried - 11-30-2015 06:28 PM (11-30-2015 06:08 PM)Thomas_Sch Wrote: Hello eried, Oh, you are right! that's why the performance was so similar, the routine using lines is much slower (62848 vs 48717 ticks) RE: RECT_P but without filling - primer - 11-30-2015 08:42 PM That's funny I made same kind of test, but I didn't test same thing as you. I didn't think about colors, but about rectangle size. I guess bigger rectangle may be slower. here is my code, I'm varying the rect size. Code: RECT_P_NOFILL0(x,y,x2,y2,col); * avg 313 for RECT * avg 460 for LINEs LINEs solution is about 50% slower than RECT. Your bench show about 30% slower, in both case RECT is better. RE: RECT_P but without filling - Han - 11-30-2015 09:55 PM What about using the more advanced form of LINE_P? RE: RECT_P but without filling - cyrille de brébisson - 12-01-2015 06:19 AM Hello, rect_p with a trensparent 'middle' will be drawn by 2 internal calls to h_line and 2 to v_line... it would be hard to be faster. In addition, it is also fast because there is little to no work needed to work on the input arguements... line_p takes a whole lot more work to create the input as they are more complex. Cyrille |