【问题标题】:Convert SWF to PNG image with transparency将 SWF 转换为具有透明度的 PNG 图像
【发布时间】:2012-01-29 02:02:47
【问题描述】:

我正在使用 c# 中的 SWFtoImage 工具将 swf 文件转换为 png 图像。我能够成功转换文件,但问题是透明度。转换后的图像包含black background,而不是transparent,您可以在附件中看到。

我该如何解决这个问题?由于该工具无法创建透明图像,是否可以在 .net 中对converted png image 进行操作并使其背景透明?

当前代码:

        //Namespace: BytescoutSWFToVideo;

        // Create an instance of SWFToVideo ActiveX object
        SWFToVideo converter = new SWFToVideo();

        // Register SWFToVideo
        converter.RegistrationName = "demo";
        converter.RegistrationKey = "demo";

        // set input SWF file
        converter.InputSWFFileName = @"D:\image2069.swf";

        // Enable trasparency
        converter.RGBAMode = true;

        // Extract all frames to .\Output sub-folder
        converter.ConvertAllToPNG(@"D:\Result\");

This is the swf file.

【问题讨论】:

  • 为什么你的问题被标记为c#.net
  • 因为,我希望它在 c# 中完成; is it possible in .net to manipulate on the converted png image and make its background transparent?
  • 好的,那么您当前的代码是什么样的?

标签: c# .net image flash transparency


【解决方案1】:

我对 SWFToImage 了解不多。但该公司的网站包含带有以下注释的演示代码(翻译成 C#):

// Enable trasparency - set BEFORE setting input SWF filename
converter.RGBAMode = true;

因此,您可能必须更改语句的顺序。

【讨论】:

    猜你喜欢
    • 2011-06-04
    • 2018-06-05
    • 2011-01-25
    • 2015-01-26
    • 2021-12-06
    • 2020-09-05
    • 2016-07-27
    • 1970-01-01
    • 2016-04-30
    相关资源
    最近更新 更多