多态分割画法
<p>foxui对多态图片采用了横向合并的方式
比如一个按钮的四个状态
默认,鼠标激活 ,鼠标按下 ,不可用
图片如下
<img src="https://www.showdoc.cc/server/api/common/visitfile/sign/85e72c7ec69d423e17bdecad27b916c0?showdoc=.jpg" alt="" />
那么设了statecount 为4,foxui会根据需要取四个图中的一个画到目标区域
当然如果你的目标区域大于原图,那么就会拉伸画上去。</p>
<p>foxuiutils 提供了此画法
HorDrawBmp32ByIndex(Dstbmp,SrcBmp:TBitmap32;AW:Integer;DstRect:TRect;index:Integer);overload;
HorDrawBmp32ByIndex(Dstbmp,SrcBmp:TBitmap32;AW:Integer;DstRect,SrcRect:TRect;index:Integer);overload;</p>
<p>dstbmp 目标图片
srcbmp 原图
aw 横向单图宽度 即 原图总宽阔 div statecount
dstrect 目标区域
srcrect 原图区域
index 取里面第几个图 我们从0开始 0 为第一态</p>