东坡下载

电脑版
提示:原网页已由神马搜索转码, 内容由www.uzzf.com提供.

首页编程开发程序源码→ Java的Flash类库(JSwiff) 8.0 官网最新版

Java的Flash类库(JSwiff)

Java的Flash类库(JSwiff)8.0 官网最新版

  • 大小:2.4M
  • 语言:中文
  • 平台:WinAll
  • 更新:2015-05-27 17:17
  • 等级:
  • 类型:程序源码
  • 网站:http://www.uzzf.com
  • 授权:免费软件
  • 厂商:
  • 产地:国产软件
好用50%(1票)
坑爹50%(1票)
软件介绍软件截图相关软件软件教程网友评论下载地址

相关推荐:

    JSwiff 是一款开源的,基于Java的操作Macromedia Flash file 的框架,可以创建,和操作Flash文件。JSwiff 还提供了JSwiff Investigator,可以直接分析现有的SWF文件的结构,得到Tag层次的信息..

    其他不多说,喜欢的人自己可以到该网站去了解,下面我就拿出一个例子来。呵~~从官方那边修改过来的,我就不多做解释了(呵~人家说得很明白啦,虽然有点烦琐)

    Java的Flash类库(JSwiff)用法

    import java.io.FileOutputStream;
    import java.io.IOException;
    import com.jswiff.SWFWriter;
    import com.jswiff.SWFDocument;
    import com.jswiff.swfrecords.Rect;
    import com.jswiff.swfrecords.RGBA;
    import com.jswiff.swfrecords.Matrix;
    import com.jswiff.swfrecords.tags.DefineFont2;
    import com.jswiff.swfrecords.tags.DefineEditText;
    import com.jswiff.swfrecords.tags.PlaceObject2;
    import com.jswiff.swfrecords.tags.ShowFrame;
    public class CreateSwf 
    {
    public static void main(String[] args) 
    {
      String fileName = "test.swf";
      SWFDocument document = new SWFDocument();
      // first we define a font for the text
      // get a character ID for the font
      int fontId = document.getNewCharacterId();
      // use a standard font (e.g. Arial), we don't want to define shapes for each glyph
      DefineFont2 defineFont2 = new DefineFont2(fontId, "Arial", null, null);
      document.addTag(defineFont2);
      // get a character ID for our text
      int textId = document.getNewCharacterId();
      // dynamic text is a good way to go, we use DefineEditText for this
      // we don't care about bounds and variables
      DefineEditText defineEditText = new DefineEditText(
       textId, new Rect(0, 0, 0, 0), null);
      // we have set the text bounds to a zero rectangle;
      // to see the whole text, we set the autosize flag
      defineEditText.setAutoSize(true);
      // assign the font defined above to the text, set font size to 24 px (in twips!)
      defineEditText.setFont(fontId, 20 * 24);
      // set text color to red
      defineEditText.setTextColor(new RGBA(255, 0, 0, 255));
      // don't let viewers mess around with our text
      defineEditText.setReadOnly(true);
      // finally set the text
      defineEditText.setInitialText("弃天笑(soda) test!");
      document.addTag(defineEditText);
      // place our text at depth 1
      PlaceObject2 placeObject2 = new PlaceObject2(1);
      placeObject2.setCharacterId(textId);
      // place text at position (45; 10) (in twips!)
      placeObject2.setMatrix(new Matrix(20 * 45, 20 * 10));
      document.addTag(placeObject2); // place text
      document.addTag(new ShowFrame()); // show frame
      try 
      {
       writeDocument(document, fileName);
      } 
      catch (IOException e) 
      {
       System.out.println("An error occured while writing " + fileName + ":");
       e.printStackTrace();
      }
    }
    private static void writeDocument(SWFDocument document, String fileName)
      throws IOException
    {
      SWFWriter writer = new SWFWriter(document, new FileOutputStream(fileName));
      writer.write();
    }
    }


    Java的Flash类库(JSwiff)截图

    热门评论
    最新评论
    发表评论查看所有评论(0)
    昵称:
    表情:高兴可汗我不要害羞好下下下送花屎亲亲
    字数: 0/500(您的评论需要经过审核才能显示)

      编辑推荐