• 追加された行はこの色です。
  • 削除された行はこの色です。
#author("2020-05-07T14:27:05+09:00","","")
#freeze
#author("2020-05-07T14:27:59+09:00","","")
[[Ys TOOLs C]]

chg touka color 0.1.0~
~
・始めに~
このTOOLは画像を読み込んで colorが0,0,0の場所を1,1,1に変換し~
一番左上のcolorと同じ色の場所を0,0,0に変換するTOOLです~
つまり手軽に透過色に変換するTOOLです~
~
・作成の動機~
画像の透過色の描き方がめんどくさくて作成してみました~
~
・使い方~
記述予定~
~
作成:高畑ラボ(Y_repeat)~
~
・連絡先~
バグなどありましたらご報告ください~
また改造後再配布時配布URLを教えていただけると嬉しいです~
y.tack2010@gmail.com~
#code(C,nooutline){{
screen 0,160,250
cls 1
mes "LOAD FILE NAME"
var4load_pic_name=""
input var4load_pic_name,120,20
ID4load_pic_name=stat
button "読み込み",*l_pic_load
mes "SAVE FILE NAME"
var4save_pic_name=""
input var4save_pic_name,120,20
ID4save_pic_name=stat
button "保存",*l_pic_save
mes "win_size"
var4win_size=""
input var4win_size,120,20
ID4win_size=stat
button "変換",*l_do_chg
button "テスト",*l_do_test
screen 1,160,100
cls 2
screen 2,160,100
cls 3
stop
*l_pic_save
	gsel 1
	bmpsave var4save_pic_name
	stop
*l_pic_load
	gsel 1
	picload var4load_pic_name
	pic_x=ginfo_winx
	pic_y=ginfo_winy
	gsel 0
	var4win_size=""+pic_x+","+pic_y
	objprm ID4win_size,var4win_size
	stop
*l_do_chg
	gsel 1
	pic_x=ginfo_winx
	pic_y=ginfo_winy

	color 1,1,1
	repeat pic_y
		this_y=cnt
		repeat pic_x
			this_x=cnt
			pget this_x,this_y
				if ginfo_r==0{
					if ginfo_g==0{
						if ginfo_b==0{
							color 1,1,1
							pset this_x,this_y
						}
					}
				}
		loop
	loop

	color 0,0,0
	pget 0,0
	the_r=ginfo_r
	the_g=ginfo_g
	the_b=ginfo_b
	repeat pic_y
		this_y=cnt
		repeat pic_x
			this_x=cnt
			pget this_x,this_y
				if ginfo_r==the_r{
					if ginfo_g==the_g{
						if ginfo_b==the_b{
							color 0,0,0
							pset this_x,this_y
						}
					}
				}
		loop
	loop
	stop
*l_do_test
	gsel 1
	pic_x=ginfo_winx
	pic_y=ginfo_winy
	gsel 2
	screen 2,pic_x,pic_y
	cls 3
	gmode 2,pic_x,pic_y
	gcopy 1,0,0,pic_x,pic_y
	stop
}}