今天遇到 ARGB 轉 RGB 這個問題,很弱的我看不明白這篇將ARGB的數值轉為RGB的碎碎念 (很宅, 正妹勿入) 的作法。而這裡提到的
int nValue = yourColor.ToArgb() &0xFFFFFF;
我做出來得到 B 值跟 R 值相反的情況(囧),所以我就用下面一點也不高級的方法解決我的問題。
color = (int)MyDialog.Color.R + (int)MyDialog.Color.G * 256 + (int)MyDialog.Color.B * 256 * 256;
//color = R + G*256 + B*256*256
[C#] ARGB 轉 RGB
Posted on 六月 2, 2009 by hsinjungwu
[C++] PLS2 Algorithm
Posted on 二月 5, 2009 by hsinjungwu
[C++] 找六角幻方的唯一解
Posted on 一月 22, 2009 by hsinjungwu
維基百科上有對六角幻方 (Magic Hexagon) 的介紹,而在我的另一個 blog 上我也有寫出三層以上的六角幻方不存在的証明。而程式部份我利用這裡提到的兩個條件(這其實自己推也能推的到 XD )
67 < A < 76
跟
No integer may be a vertex integer, a_i, unless it appears in two of these triads. So, the smallest possible vertex integer is 3
以及他給的符號標示,另外我也固定了答案的形狀,所以不會有旋轉或是鏡射的情形,而剩下來的的就完全是暴力法。
存放在: 科科成事 | 屬於此標籤: Dev-C++, Magic Hexagon, 六角幻方 | 張貼留言 »
判斷撲克牌牌型
Posted on 十二月 5, 2008 by hsinjungwu
發撲克牌
Posted on 十一月 20, 2008 by hsinjungwu