当前位置:网站首页>Aardio - 阴影渐变文字
Aardio - 阴影渐变文字
2022-07-01 07:50:00 【卢光庆】
本例使用了 godking.paint 库,请前往:http://chengxu.online 下载。
效果:
代码1:
import win.ui;
/*DSG{
{*/
var winform = win.form(text="aardio form";right=582;bottom=531)
winform.add(
plus={cls="plus";left=37;top=17;right=537;bottom=517;z=1}
)
/*}}*/
import godking.paint
var p = godking.paint.fromPlus(winform.plus,true/*自动刷新*/,true/*重绘背景*/)
//创建影线画刷
var b = p.brush.hatchBrush(10/*笔刷风格0-52*/,0xFF000000/*前景色*/,0xFFFFFFFF/*背景色*/)
//用画刷绘制影线文字
var font = ::LOGFONT(name="黑体";point=120;color=0xFFFF0000;brush=b)
p.drawText(,/*y1*/,/*x2*/,/*y2*/,"阴影文字",font,0,0,0)
//创建线性渐变画刷
colors = {0xFFFF0000,0xFF00FF00,0xFF0000FF,0xFF00FFFF,0xFFFFFF00,0xFFFF00FF}
points = {0,0.2,0.5,0.7,0.8,1}
b = p.brush.lineBrush({1,1}/*起始坐标*/,{200,200}/*结束坐标*/,colors/*颜色数组*/,points/*位置数组*/,/*包围模式wrapMode*/)
//用画刷绘制线性渐变文字
font.brush = b
p.drawText(-5,-5/*y1*/,/*x2*/,/*y2*/,"阴影文字",font,0,0,0)
winform.show();
win.loopMessage();
代码2:
import win.ui;
/*DSG{
{*/
var winform = win.form(text="aardio form";right=582;bottom=531)
winform.add(
plus={cls="plus";left=37;top=17;right=537;bottom=517;z=1}
)
/*}}*/
import godking.paint
var p = godking.paint.fromPlus(winform.plus,true/*自动刷新*/,true/*重绘背景*/)
//创建阴影路径
var path=..gdip.path(1/*_FillModeWinding*/)
path.addstring("阴影文字",gdip.family("黑体"),0,120*1.31,::RECTF(5,5,winform.plus.width,winform.plus.height),gdip.stringformat())
//创建影线画刷
var b = p.brush.hatchBrush(18/*笔刷风格0-52*/,0xFF000000/*前景色*/,0xFFFFFFFF/*背景色*/)
//用画刷绘制影线文字
p.fillPath(path,b/*填充颜色或brush对象*/)
//创建前景文字路径
var path=..gdip.path(1/*_FillModeWinding*/)
path.addstring("阴影文字",gdip.family("黑体"),0,120*1.31,::RECTF(0,0,winform.plus.width,winform.plus.height),gdip.stringformat())
//创建线性渐变画刷
colors = {0xFFFF0000,0xFF00FF00,0xFF0000FF,0xFF00FFFF,0xFFFFFF00,0xFFFF00FF}
points = {0,0.2,0.5,0.7,0.8,1}
b = p.brush.lineBrush({1,1}/*起始坐标*/,{200,200}/*结束坐标*/,colors/*颜色数组*/,points/*位置数组*/,/*包围模式wrapMode*/)
//用画刷绘制线性渐变文字
p.drawPath(path,0xFF000000/*线条颜色或pen对象*/,3/*线宽*/)
p.fillPath(path,b/*填充颜色或brush对象*/)
winform.show();
win.loopMessage();
边栏推荐
- 2022年流动式起重机司机考试练习题及在线模拟考试
- Android screen adaptation (using constraintlayout), kotlin array sorting
- Rk3399 platform development series explanation (network debugging) 7.30. What will affect the sending process of TCP packets?
- How do the top ten securities firms open accounts? In addition, is it safe to open a mobile account?
- The H5 page has set the font thickness style, but the wechat access style in Huawei mobile phone doesn't take effect?
- 力扣——求一组字符中的第一个回文字符
- [programming compulsory training 3] find the longest consecutive number string in the string + the number that appears more than half of the times in the array
- Conscience Amway universal wheel SolidWorks model material website
- LM08丨网格系列之网格反转(精)
- 论文学习——水文时间序列相似性查询的分析与研究
猜你喜欢
2022 test questions and mock examinations for main principals of hazardous chemicals business units
[programming training] delete public characters (hash mapping) + team competition (greedy)
华为ModelArts训练Alexnet模型
ONES 创始人王颖奇对话《财富》(中文版):中国有没有优秀的软件?
LM08丨网格系列之网格反转(精)
Inftnews | from "avalanche" to Baidu "xirang", 16 major events of the meta universe in 30 years
2022广东省安全员A证第三批(主要负责人)特种作业证考试题库模拟考试平台操作
LSTM of RNN
How to check ad user information?
[website architecture] solve 90% of distributed transactions in one move, and introduce the working principles and application scenarios of database transactions and distributed transactions
随机推荐
Inftnews | from "avalanche" to Baidu "xirang", 16 major events of the meta universe in 30 years
ContentType所有类型对比
Principle and process of embossing
Conscience Amway universal wheel SolidWorks model material website
[batch dos-cmd command - summary and summary] - Common operators in the CMD window (<, < <, & <,>, > >, & >, & >, & &, ||, (),;, @)
2022制冷与空调设备运行操作国家题库模拟考试平台操作
十大劵商如何开户?另外,手机开户安全么?
Custom events of components ①
【网站架构】一招搞定90%的分布式事务,实打实介绍数据库事务、分布式事务的工作原理应用场景
力扣每日一题-第32天-1822.数组元素积的符号
Li Kou daily question - day 31 -202 Happy number
weback5基础配置详解
TCP/UDP 通信问题整理
Gru of RNN
How to troubleshoot SharePoint online map network drive failure?
redisson使用全解——redisson官方文档+注释(上篇)
【批处理DOS-CMD命令-汇总和小结】-Cmd窗口中常用操作符(<、<<、&<、>、>>、&>、&、&&、||、|、()、;、@)
Li Kou daily question - day 31 -1790 Can a string exchange be performed only once to make two strings equal
[programming compulsory training 3] find the longest consecutive number string in the string + the number that appears more than half of the times in the array
Scala language learning-07-constructor