문제
버튼에 특별한 목적의 아이콘이 필요합니다.
해결책
자신의 사진을 만들어 단추의 아이콘으로 지정하십시오. 첫째, 간단한 예입니다. ms 페인트를 사용하여 비트 맵을 만들 수 있습니다.
New Window( "hello", Button Box( "optional text", <<SETICON></SETICON>
Huge button icon without transparency투명성이없는 거대한 버튼 아이콘
선택적 텍스트를위한 빈 문자열을 원할 수 있습니다. 아마도 훨씬 작은 그림을 원할 것입니다. 그 그림은 100x100 이상입니다. 일반적인 아이콘은 16x16 또는 32x32입니다. 또한 투명 배경을 가진 .png 파일을 만들 수있는 그리기 프로그램이 필요합니다. 위의 버튼은 버튼의 회색 배경과 충돌하는 흰색 배경을 가지고 있습니다 (테마에 따라 회색이 아닐 수도 있음).
다음은 JMP 마커의 사진을 찍어 아이콘을 만드는 예제입니다.
// You'll need to restart JMP to see changes you make to the icon files
// because JMP caches them on first load and will not notice changes.
// (Or you can just make new names while testing, but that isn't a
// good idea for production code)
iconsize=16; // balance this with markersize, below
gridsize=200; // more than big enough for markers.
gridcenterX=gridsize/2+1; // may need +/- 1 or 2 for centering
gridcenterY=gridsize/2+2; // may need +/- 1 or 2 for centering
iconhalf=iconsize/2;
For( icon = 0, icon <= 31, icon++,
// make a graph of just this marker, centered
gb = Graph Box(
FrameSize( gridsize, gridsize ), //
Y Scale( 0, 2 ),
X Scale( 0, 2 ),
suppressaxes( 1 ),
Marker( icon, {1, 1} ),<<BACKGROUNDCOLOR></BACKGROUNDCOLOR>
Buttons with custom icons사용자 정의 아이콘이있는 버튼