开发者

Giving a border to Canvas

开发者 https://www.devze.com 2023-01-09 03:47 出处:网络
In Flex, I am using var canvasEdit:Canvas = new Canvas(); canvasEdit.setStyle(\"borderCol开发者_开发知识库or\", 0x0134FF);

In Flex, I am using

var canvasEdit:Canvas = new Canvas();
canvasEdit.setStyle("borderCol开发者_开发知识库or", 0x0134FF);
canvasEdit.setStyle("borderThickness", 3);

But I am not able to put border on the sides of the Canvas.


Try adding the following line:

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消