#include "a2d.hsp"
//#include "hspda.as"

#uselib "user32.dll"

#func PrintWindow "PrintWindow" int,int,int
#define PW_CLIENTONLY 0x00000001

#packopt runtime "Valicon.hrt"
#packopt name "VALCHARMAKER_Ver10"

	buffer 10,100,100
	picload "Char1_1.png",1
	buffer 11,100,100
	picload "Char1_2.png",1
	buffer 12,100,100
	picload "Char1_3.png",1

	buffer 20,100,100
	picload "Char2_1.png",1
	buffer 21,100,100
	picload "Char2_2.png",1
	buffer 22,100,100
	picload "Char2_3.png",1

	buffer 30,100,100
	picload "Char3_1.png",1
	buffer 31,100,100
	picload "Char3_2.png",1
	buffer 32,100,100
	picload "Char3_3.png",1
	
file_name="VALPC2.png"

	screen 0,800,1200
	title "@L[J["
	sdim OFrN,64,20

	color 0,89,82
	boxf 0,0,800,1200

	objmode 2 ; font߂@\
	objsize 200, 30 ; {^̂̂̑傫
	OFNo=1
	OFrN(0)="Tv1"
	OFrN(1)="Tv2"
	OFrN(2)="Tv3"
	font "MS UI Gothic", 25, 1
	pos 300,40
	color 255,255,255
	mes "ǉ"
	pos 50,40
	mes "ǉL"
	pos 300,80
	font "MS UI Gothic", 22, 1
	input OFNo,50,30,1
	pos 400,80
	button "",*SetCG
	pos 50,80
	font "MS UI Gothic", 22, 1
	input OFrN(0),200,30,8
	pos 50,130
	font "MS UI Gothic", 22, 1
	input OFrN(1),200,30,8
	pos 50,180
	font "MS UI Gothic", 22, 1
	input OFrN(2),200,30,8
	stop  


*SetCG	
	notesel data
	//SOFNo=str(OFNo)
	//pos 300,180
	//color 255,255,255
	//mes OFNo
	noteadd str(OFNo),0
	noteadd OFrN(0),1
	noteadd OFrN(1),2
	noteadd OFrN(2),3
	//	t@CƂďo͂
	notesave "CharData1.val"

	clrobj
	
	screen 0,800,1200
	color 0,89,82
	boxf 0,0,800,1200
	
	pos 0,0
	gcopy 10, 0, 0, 100, 100
	pos 199,0
	color 0,89,82:gzoom -100,100,10,0,0,100,100
	//gcopy 10, 0, 0, 100, 100
	pos 200,0
	gcopy 11, 0, 0, 100, 100
	pos 399,0
	color 0,89,82:gzoom -100,100,11,0,0,100,100
	//gcopy 11, 0, 0, 100, 100
	pos 400,0
	gcopy 12, 0, 0, 100, 100
	pos 599,0
	color 0,89,82:gzoom -100,100,12,0,0,100,100
	//gcopy 12, 0, 0, 100, 100

	pos 0,100
	gcopy 20, 0, 0, 100, 100
	pos 199,100
	color 0,89,82:gzoom -100,100,20,0,0,100,100
	//gcopy 10, 0, 0, 100, 100
	pos 200,100
	gcopy 21, 0, 0, 100, 100
	pos 399,100
	color 0,89,82:gzoom -100,100,21,0,0,100,100
	//gcopy 11, 0, 0, 100, 100
	pos 400,100
	gcopy 22, 0, 0, 100, 100
	pos 599,100
	color 0,89,82:gzoom -100,100,22,0,0,100,100
	//gcopy 12, 0, 0, 100, 100

	pos 0,200
	gcopy 30, 0, 0, 100, 100
	pos 199,200
	color 0,89,82:gzoom -100,100,30,0,0,100,100
	//gcopy 10, 0, 0, 100, 100
	pos 200,200
	gcopy 31, 0, 0, 100, 100
	pos 399,200
	color 0,89,82:gzoom -100,100,31,0,0,100,100
	//gcopy 11, 0, 0, 100, 100
	pos 400,200
	gcopy 32, 0, 0, 100, 100
	pos 599,200
	color 0,89,82:gzoom -100,100,32,0,0,100,100
	//gcopy 12, 0, 0, 100, 100
	wait 50
//ʂۑEBhȄ擾
hnd = hwnd
sx = ginfo_sx
sy = ginfo_sy

buffer 1, sx, sy
PrintWindow hnd, hdc, PW_CLIENTONLY //EBhE̒gbufferɕ`悷

bmpsave "test1.bmp"

screen 1,sx,sy
picload "test1.bmp"

alCreateImage 0,sx,sy		//zC[W쐬
alCopyScreenToImage 1,0,0,0,sx,sy,0,0	//HSP Screen 1  zC[W 0 ɃRs[
alSaveFile file_name, "image/png"

/*dialog "bmp",17
if stat{
	s=refstr
	if getpath(s, 2)=="":s+=".bmp"
	bmpsave s //ۑ
}*/
