zoukankan      html  css  js  c++  java
  • ActionScript3.0平铺由外部加载的图片

    var backImage:MovieClip = new MovieClip();
    
    this.addChild (backImage);
    
    var loader:Loader = new Loader();
    loader.load (new URLRequest("http://www.baidu.com/img/logo-yy.gif"));
    loader.contentLoaderInfo.addEventListener (Event.COMPLETE,showLoadResult);
    
    function showLoadResult (event:Event):void {
            var _bitmap:Bitmap = Bitmap(loader.content);
            var matrix:Matrix = new Matrix(1, 0, 0, 1, this.stage.stageWidth / 2, this.stage.stageHeight / 2);
            var sampleSprite:Sprite = new Sprite();
    		//sampleSprite.width=500;
    		//sampleSprite.height=500;
            sampleSprite.graphics.beginBitmapFill (_bitmap.bitmapData, matrix , true , true);
            //sampleSprite.graphics.drawRect (this.stage.stageWidth / 2, this.stage.stageHeight / 2, _bitmap.width, _bitmap.height);
    		 sampleSprite.graphics.drawRect (0, 0, this.stage.stageWidth, this.stage.stageHeight);
            sampleSprite.graphics.endFill ();
            backImage.addChild (sampleSprite);
    }
    
  • 相关阅读:
    Python 双向链表的实现
    Python 单链表实现
    分享两种 Python 中的单例模式
    HTML 盒子模型
    HTML 行高
    HTML 超链接 文本修饰 背景属性
    HTML 标签分类
    HTML 文字,样式表
    HTML CSS
    HTML 锚点 空链 超链优化写法
  • 原文地址:https://www.cnblogs.com/Lewis/p/1961247.html
Copyright © 2011-2022 走看看