(转)二维码中心添加图标
By
admin
at 2017-11-21 • 1人收藏 • 1472人看过
import win.ui; /*DSG{{*/ var winform = win.form(text="aardio form";right=759;bottom=469) winform.add( picturebox={cls="picturebox";left=173;top=146;right=373;bottom=346;z=1} ) /*}}*/ winform.show() import gdip import fsys.info import com.picture import win.image import qrencode.bitmap var qr = qrencode.bitmap("aardio测试文本",,3) var qrbmp = qr.copyBitmap(200)//生成200px图片 var brush = gdip.solidBrush(0xFFFFFFFF); var tmpbmp = gdip.bitmap(50,50) tmpbmp.graphics.fillRectangle(brush,0,0,50,50)//创建50*50白色图片 qrbmp.graphics.drawImageCenter(tmpbmp,::RECT(0,0,200,200))//把白色图片粘贴到二维码中间 qrbmp.graphics.drawImageCenter(gdip.bitmap(com.picture.fromIcon(fsys.info.get(io._exepath,0x100/*_SHGFI_ICON*/|0x4000/*_SHGFI_SYSICONINDEX*/).hIcon).CopyHandle(50,50)),::RECT(0,0,200,200))//把exe图标粘贴到二维码中间 winform.picturebox.image = qrbmp.saveToBuffer() win.loopMessage();
感谢群里:Kio1分享
登录后方可回帖