c# - Convert color to RRRGGGBBB -


currently rewriting .ini file of existing program. .ini file contains rgb values.

now changing rgb values problem existing program reads value if both r, g , b values have 3 numbers.

for example, if write down rgb value says: 255,0,0 or 0,0,225. way existing program able read rgb values if wrote down this: 255,000,000 or 000,000,255.

the code use write down rgb values:

byte[] seatl1 = new utf8encoding(true)                .getbytes("l1=" + r2.backcolor.r.tostring() +                           ", " + r2.backcolor.g.tostring() +                           ", " + r2.backcolor.b.tostring()); fsnew.write(seatl1, 0, seatl1.length); 

is there simple way this?

try this:

byte[] seatl1 = new utf8encoding(true)            .getbytes("l1=" + r2.backcolor.r.tostring("000") +                       ", " + r2.backcolor.g.tostring("000") +                       ", " + r2.backcolor.b.tostring("000")); fsnew.write(seatl1, 0, seatl1.length); 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -