zoukankan      html  css  js  c++  java
  • 对Chris Waugh的MovieClip的反馈内容

    以下内容是我对Chris Waugh的MovieClip的反馈内容,这是我第二次对外国网友的技术反馈。

    Hi Chris,
    Thank you for your Open-source spirit!Based on your great work,I implement it and make a little improvement to solve my practical MovieClip-printing problem. The major progress i have made is to work out a way of printing a MovieClip with Multi-frames only by one printjob sending.of course, i resolved the question of "printing the full width of the Movieclip ".Because swf stores content in the form of vectorgraph,what you need do is make sure "clip.height=printArea.height;clip.width=printArea.width;". It is a easy way.
    ========================================

         1//MC printing Function
         2private function printMovieClip(clip:MovieClip):void
         3{
         4    var printJob:PrintJob=new PrintJob();
         5    var printArea:Rectangle;
         6    if (!printJob.start())
         7      return;
         8    //The page you choose to print ,"selectPages" is a mx:combox object i used to support printing one frame of MC
         9    var printPage:int=selectPages.selectedItem.data;
        10    if (printPage == 0) //print all frames of the MovieClip
        11      {
        12        for (var i:int=1; i <= clip.totalFrames; i++)
        13        {
        14          clip.gotoAndStop(i);
        15          /* Resize movie clip to fit within page width */
        16          clip.width=printJob.pageWidth;
        17          clip.scaleY=clip.scaleX;
        18          /* Store reference to print area in a new variable! Will save on scaling */
        19          printArea=new Rectangle(0, 0, printJob.pageWidth, printJob.pageHeight);
        20          //numPages=Math.ceil(clip.height / printJob.pageHeight);
        21                  /* Add pages to print job */
        22          printJob.addPage(clip, printArea);
        23        }
        24      }
        25    else //print the selected frame
        26    {
                 //goto the selected frame firstly
        27        clip.gotoAndStop(printPage);
        28        /* Resize movie clip to fit within page width */
        29        clip.width=printJob.pageWidth;
        30        clip.scaleY=clip.scaleX;
        31        printArea=new Rectangle(0, 0, printJob.pageWidth, printJob.pageHeight);
        32         /* Add pages to print job */
        33        printJob.addPage(clip, printArea);
        34        }
        35
        36        /* Send print job to printer */
        37        printJob.send();
        38         /* Delete job from memory */
        39        printJob=null;
        40
        41    }


       

    If you want more information ,you want to look at my clip image and you understand a little chinese, welcome you visit my blog:http://www.cnblogs.com/wuhenke/archive/2009/11/17/1604923.html
    ----------------------------------------

      best wishes!

      wuhenke

    http://stackoverflow.com/questions/1422259/as3-using-printjob-to-print-a-movieclip/1749529#1749529

  • 相关阅读:
    已设定选项readonly请加!强制执行
    Linux下NVIDIA显卡驱动安装方法
    C#使用MiniDump导出内存快照MiniDumper
    一些陈旧的注册表垃圾清理脚本:注册表冗余数据清理.reg
    脚本精灵一些脚本
    本地安装SonarQube Community8.1社区版进行代码质量管控
    spring redistemplate中使用setHashValueSerializer的设置hash值序列化方法
    spring-core-5.0.6.RELEASE-sources.jar中java源代码不全
    lombok插件/slf4j中字符串格式化
    light4j/light-4j一个轻量级的低延时、高吞吐量、内存占用量小的API平台
  • 原文地址:https://www.cnblogs.com/wuhenke/p/1605016.html
Copyright © 2011-2022 走看看