ページ 11

Win32API プログラム

Posted: 2012年12月30日(日) 19:43
by mori
RGB関数で指定する3つの整数をCOLORREF型の値から得る方法はあるでしょうか?

Re: Win32API プログラム

Posted: 2012年12月30日(日) 19:56
by nil
http://ha1.seikyou.ne.jp/home/ikkyu/wor ... orref.html
ここが参考になるかと思います。

Re: Win32API プログラム

Posted: 2012年12月30日(日) 19:58
by みけCAT
まずはググりましょう。
[search=google]COLORREF 成分 取得[/search]

コード:

#include <stdio.h>
#include <windows.h>

int main(void) {
	COLORREF color;
	color=RGB(64,128,255);
	printf("R=%d,G=%d,B=%d\n",
		GetRValue(color),GetGValue(color),GetBValue(color));
	return 0;
}
http://rararahp.web.fc2.com/vc/200210/02100098.html