|
|
check out this test macro:
(vtest1,"(15790320/65536)",CALC_EXPRESSION,"0","", "0")
(-100,-100,"%vtest1%","Message",1,0,0,1)
The answer should be 240, as I don't want anything after the decimal point.
But it returns 241.
You'll notice above that there's no command var_oper or msg.
It seems that the forum software is eating these. eek
EDIT: I'm using V7.4.8 of Macro Toolworks Pro
EDIT 2 17th Jan 2012: Okay what I'm trying to do is use display_getpixel and then
seperating out the individual colors so that I can look for relationships between
them and do the necessary processing in each case. To get the colors out I would
normally use "mod" but I didn't see that in MTW. So I'm doing a formula that does
divides, multiplies and subtractions to fake the modulo operator. Starting with
vColor I want the top 8 bits. So vColor-((vColor/65536)*65536) should work.
But because the result of vColor/65536 is not correct (is it rounding up??),
I end up with a negative number. I guess I could ask for a decimal place and then
use int etc. Maybe there is a simpler way for this particular case, but I'm still
thinking that rounding up is not appropriate when no decimal places are asked for,
which basically means dealing in integers. I'm planning a bunch of macros using
getpixel and processing the colors so I'm hanging out for a solution here if
anyone can help thanks. |
IP Logged
|
|
Last Edited On: 16-01-2012 23:14:35 By glenmcd for the Reason |