看过你很多大作,还请你出手援助。 本帖最后由 netegg 于 2012-3-1 14:33 编辑
回复 16# 楼上风云
我没出过什么作品,不过可以给你点算是提示的东西,汉字输入,不是只拆出笔画解决的,本身有一套顺序,比如先上后下,先左后右,先横后竖一类的,从这个角度想,不用拆出具体的笔画,只要看位置即可
另外,汉字的基本笔画没有那么多,分析下共性,可以简化的
对了,那个在小学新华字典的附录里好像写着有 本帖最后由 smartzbs 于 2012-3-1 15:50 编辑
回复smartzbs
先感谢您的热心关注,测试能显示笔顺走势,功能方面是实现了。
同时,如果解决如附件图 ...
楼上风云 发表于 2012-3-1 11:32 http://www.autoitx.com/images/common/back.gif
宋体“我”字供参考:
$sHzBs = "0:(324,54) (360,90) (234,120) (60,150)#1:(30,282) (726,282) (672,264) (618,282)#2:(240,120) (240,678) (234,708) (198,750) (114,678)#3:(30,486) (54,522) (396,360)#4:(408,36) (444,60) (450,312) (456,408) (468,492) (480,528) (498,570) (528,618) (570,666) (618,708) (660,732) (708,750) (714,582)#5:(612,336) (648,366) (576,462) (522,522) (474,570) (402,624) (312,678)#6:(522,90) (594,150) (642,210)" 感谢您的关注,相信有您和大伙的关切,一定能解决的。
如果可能,将它写成为UDF,最适用拓展。也可以用于界面启动特效显示。 ...
楼上风云 发表于 2012-3-1 13:59 http://www.autoitx.com/images/common/back.gif
这个很实用,期待你的UDF。 回复 18# smartzbs
你的方案是一种角度,可以借鉴。只是这种变量直接赋值方案,可能通用性会欠佳。
先谢谢你的关注了。
顺便问下,$SHZBS变量的值是如何获取的,方便提供思路或工具吗? 本帖最后由 smartzbs 于 2012-3-2 09:41 编辑
走势、缩放、位置、笔重演示:
#include <GDIPlus.au3>
Dim $aHzBs
;宋体笔顺库
$aHzBs = "0:(612,24) (648,48) (528,72) (390,90) (282,102) (120,114)#1:(144,138) (204,204) (228,252)#2:(330,126) (384,192) (402,246)#3:(564,114) (600,132) (528,216) (462,282)#4:(78,252) (72,330) (60,372) (30,414)#5:(78,282) (696,282) (642,366) (696,282) (726,264)#6:(66,408) (672,408) (630,390) (588,408)#7:(312,294) (348,312) (318,384) (288,444) (246,510) (186,582) (132,630) (36,684)#8:(252,504) (540,504) (570,486) (540,504) (462,600) (408,654) (330,702) (264,726) (204,744) (114,756)#9:(258,504) (306,576) (354,624) (420,672) (504,708) (564,726) (654,744) (720,750)"
$aHzBs = "0:(324,54) (360,90) (234,120) (60,150)#1:(30,282) (726,282) (672,264) (618,282)#2:(240,120) (240,678) (234,708) (198,750) (114,678)#3:(30,486) (54,522) (396,360)#4:(408,36) (444,60) (450,312) (456,408) (468,492) (480,528) (498,570) (528,618) (570,666) (618,708) (660,732) (708,750) (714,582)#5:(612,336) (648,366) (576,462) (522,522) (474,570) (402,624) (312,678)#6:(522,90) (594,150) (642,210)"
$aHzBs = "0:(144,24) (204,96) (216,120) (228,174)#1:(30,204) (276,204) (312,180) (276,204) (222,282) (174,342) (132,390) (90,438) (42,486) (6,522)#2:(180,336) (180,762)#3:(192,342) (246,384) (276,414) (306,450)#4:(318,102) (744,102) (696,84) (648,102)#5:(402,162) (402,360)#6:(402,192) (648,192) (672,168) (648,192) (648,360)#7:(648,324) (402,324)#8:(336,390) (336,750)#9:(336,426) (702,426) (726,408) (702,426) (702,744)#10:(702,558) (336,558)#11:(522,426) (522,702)#12:(336,702) (702,702)"
$aHzBs = "0:(270,132) (618,132) (648,108) (618,132) (618,378)#1:(234,240) (738,240) (690,222) (642,240)#2:(618,348) (270,348)#3:(276,456) (666,456) (618,438) (570,456)#4:(234,570) (714,570) (666,552) (618,570)#5:(426,24) (456,36) (456,720)#6:(36,132) (228,132) (258,114) (228,132) (78,348) (48,366) (78,348) (222,348) (246,324) (222,348) (204,438) (186,522) (168,576) (132,642) (90,690) (18,750)#7:(60,438) (90,510) (114,564) (150,618) (198,666) (246,702) (294,726) (366,744) (456,756) (732,756)"
$hGUI = GUICreate("汉字笔顺演示", @DesktopWidth, @DesktopHeight, 0, 0, 0x80000000);$WS_POPUP = 0x80000000
GUISetState()
_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
;_GDIPlus_GraphicsClear ($hGraphic, 0xFFFFFFFF)
;_SetCursor(@ScriptDir & "\data\default.cur", 32512)
For $i=1 To 4
_DrawHzBs($aHzBs[$i], $hGraphic, 4*$i, ($i-1)* 200)
;_GDIPlus_GraphicsClear ($hGraphic, 0xFFFFFFFF)
Next
MsgBox(4096,"ok","结束")
_GDIPlus_GraphicsDispose ($hGraphic)
_GDIPlus_Shutdown ()
GUIDelete($hGUI)
Func _DrawHzBs($sHzBs, $hGraphic, $iZoom = 1, $x0=0)
$iZoom = Int($iZoom)
If $iZoom<1 Then $iZoom=1
If $iZoom>32 Then $iZoom=32
Local $iPen = Int(32/$iZoom)
Local $aBs = StringSplit($sHzBs, '#', 2);每一个笔画
Local $aXy1, $aXy2, $aCoordinate, $iTemp
$hPen = _GDIPlus_PenCreate(0xffFF0000,$iPen);红色,重量1
For $i=0 To UBound($aBs)-1
$aCoordinate = StringRegExp($aBs[$i], "\((\d+,\d+)\)", 3);x,y坐标
For $j = 0 To UBound($aCoordinate)-2
$aXy1 = StringSplit($aCoordinate[$j],",",2)
$aXy2 = StringSplit($aCoordinate[$j+1],",",2)
;按单个笔划演示
$aXy1=Int($aXy1)
$aXy1=Int($aXy1)
$aXy2=Int($aXy2)
$aXy2=Int($aXy2)
Select;修正阿福宋体笔划顺序库Bug,为从上到下,从左到右
Case $aXy1=$aXy2 And $aXy1>$aXy2
$iTemp = $aXy1
$aXy1 = $aXy2
$aXy2 = $iTemp
Case $aXy1=$aXy2 And $aXy1>$aXy2
$iTemp = $aXy1
$aXy1 = $aXy2
$aXy2 = $iTemp
EndSelect
MouseMove(Int($aXy1/$iZoom)+$x0, Int($aXy1/$iZoom))
_GDIPlus_GraphicsDrawLine ($hGraphic, Int($aXy1/$iZoom)+$x0, Int($aXy1/$iZoom), Int($aXy2/$iZoom)+$x0, Int($aXy2/$iZoom), $hPen) MouseMove(Int($aXy2/$iZoom)+$x0, Int($aXy2/$iZoom))
Next
Sleep(50);每一个笔划之间延时,演示用
Next
EndFunc
回复smartzbs
你的方案是一种角度,可以借鉴。只是这种变量直接赋值方案,可能通用性会欠佳。
...
楼上风云 发表于 2012-3-1 16:53 http://www.autoitx.com/images/common/back.gif
字库我放上去了:
http://www.autoitx.com/thread-30662-1-1.html 有点意思哈,就是字写的有点生硬哈 回复 22# smartzbs
字库定义是关键
页:
1
[2]