给边框给画布 [英] Giving a border to Canvas
本文介绍了给边框给画布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Flex中,我使用
var canvasEdit:Canvas = new Canvas();
canvasEdit.setStyle("borderColor", 0x0134FF);
canvasEdit.setStyle("borderThickness", 3);
但是我不能把边框放在画布的两边。
But I am not able to put border on the sides of the Canvas.
推荐答案
尝试添加以下行:
canvasEdit.setStyle("borderStyle","solid");
...例如,这里是一个完整的应用程序文件示例:
...for example, here is a full application file example:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
<mx:Script>
<![CDATA[
protected function init():void
{
canvasEdit.setStyle("borderStyle","solid");
canvasEdit.setStyle("borderColor","#000000");
canvasEdit.setStyle("borderThickness","5");
}
]]>
</mx:Script>
<mx:Canvas width="200" height="200" x="0" y="0" id="canvasEdit"/>
</mx:Application>
这篇关于给边框给画布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文