Post new question
Question
Reply
 
Tutor
Posts: 12
Member Since: ‎03-01-2017
Message 1 of 5 (402 Views)

RECT_P function

[ Edited ]
Product Name: HP Prime v1
Operating System: Microsoft Windows 10 (64-bit)

The RECT_P function doesn't seem to work as expected when alpha is used. On the Calculator The Alpha is ignored and on the emulator, the high alpha value seems to be passed to the border as well as nothing is shown. Is this intended?

Reply
0
Master's Graduate
Posts: 390
Member Since: ‎01-08-2009
Message 2 of 5 (348 Views)

Re: RECT_P function

What are the inputs you are trying?

 

 

Are you up to date in the calc?

----------------------
TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
Tutor
Posts: 12
Member Since: ‎03-01-2017
Message 3 of 5 (319 Views)

Re: RECT_P function

Most of the RECT_Ps are written like this:

 

 

REPT_P(pxlCrd[1],pxlCrd[2],pxlCrd[1]+SQR-1,pxlCrd[2]+SQR-1,clr,#FF000000h);

where pxlCrd is =={x loc, y loc},

SQR is the side length of the square,

clr is the clr of the square,

and unless this changed with the update #FF000000h is full transparency.

 

This worked on ver 6030

I'm currently on ver 10637

Master's Graduate
Posts: 390
Member Since: ‎01-08-2009
Message 4 of 5 (306 Views)

Re: RECT_P function

[ Edited ]

Thanks.

 

So you are trying to draw a square, but have a fully transparent inner with nothing drawn? Is that the intent here? If so, you should just skip the last "fill" color and that is the result. That is the normal way of doing it which is why nobody seems to have ever noticed this.

 

Note that it is possible you've uncovered an unintended behavior here when you DO define a fully transparent fill. I'm checking on that and if it is a bug we'll get it on the list to fix.

 

 

Also, note that I'd highly recommend using the RGB( ) macro instead of just #AABBGGRR directly. It really will be more readable and when we change color support to 32bits in the future you are ready to go with no worries. Right now it is just using 15 bit color on your hardware calculator (but the screen supports 32).

 

 [EDIT] I think you may be right that the fill alpha is taking priorty over the outline one. The logic came from the time when you old had a "transparent" flag, not true alpha blending like you have now in later Prime versions.

----------------------
TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
Tutor
Posts: 12
Member Since: ‎03-01-2017
Message 5 of 5 (295 Views)

Re: RECT_P function

[ Edited ]

Are you sure that RECT_P draws an outlined square when you exclude fill color. Help says fill color default is edge color. When I tested this, It behaved as help said.

† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation