发光字例程

光庆 2天前 93

import win.ui;
/*DSG{{*/
var winform = win.form(text="aardio form";right=375;bottom=191)
winform.add(
plus={cls="plus";left=16;top=16;right=116;bottom=116;border={color=-8388480;width=1};z=1};
plus2={cls="plus";left=136;top=16;right=236;bottom=116;border={color=-8388480;width=1};z=2};
plus3={cls="plus";left=256;top=16;right=356;bottom=116;border={color=-8388480;width=1};z=3};
trackbar={cls="trackbar";left=8;top=136;right=360;bottom=166;max=20;min=3;z=4}
)
/*}}*/

winform.show();
import godking.paint
winform.trackbar.oncommand = function(id,event,pos){
	if( event == 8/*_SB_ENDSCROLL*/ ){

		var p1 = godking.paint(100 /*宽度*/,100/*高度*/,/*背景颜色*/,/*背景图像*/)
		p1.drawText(0 /*x1*/,0/*y1*/,100/*x2*/,120/*y2*/,"光",::LOGFONT(name="黑体";h=80;color=0xFFFF0000;bold=1),0/*格式*/,1/*水平*/,1/*垂直*/)
		var b1 = p1.getBuffer("*.png",100/*JPG质量*/,/*截取区域RECT或RECTF*/,/*宽度*/,/*高度*/,/*按比例*/,/*参数*/)
		p1.close();
		winform.plus.foreground = b1;
		
		var w = winform.trackbar.pos;
		var p2 = godking.paint(w,w);
		p2.drawImageF(0 /*x*/,0/*y*/,w/*宽*/,w/*高*/,b1/*图片*/,/*透明度或图片属性*/,/*保持比例*/);
		var b2 = p2.getBuffer("*.png",100/*JPG质量*/,/*截取区域RECT或RECTF*/,/*宽度*/,/*高度*/,/*按比例*/,/*参数*/);
		p2.close();
		winform.plus2.foreground = b2;

		var p3 = godking.paint(100,100);
		p3.drawImageF(0 /*x*/,0/*y*/,100/*宽*/,100/*高*/,b2/*图片*/,/*透明度或图片属性*/,/*保持比例*/);
		p3.drawText(0 /*x1*/,0/*y1*/,100/*x2*/,120/*y2*/,"光",::LOGFONT(name="黑体";h=80;color=0xFFFFFFFF;bold=0),0/*格式*/,1/*水平*/,1/*垂直*/)
		var b3 = p3.getBuffer("*.png",100/*JPG质量*/,/*截取区域RECT或RECTF*/,/*宽度*/,/*高度*/,/*按比例*/,/*参数*/);
		p3.close();
		winform.plus3.foreground = b3;		
	}
}
winform.trackbar.oncommand(0,8,0);
win.loopMessage();


最新回复 (1)
  • breezee 1天前
    0 2

返回