简体   繁体   English

将SWF转换为具有透明性的PNG图像

[英]Convert SWF to PNG image with transparency

I'm converting a swf file to png image using SWFtoImage tool in c#. 我正在使用c#中的SWFtoImage工具将swf文件转换为png图像。 I'm able to convert the file successfully, but the problem is transparency. 我能够成功转换文件,但是问题是透明性。 The converted image contains a black background instead of transparent , as you can see in the attached image. 转换后的图像包含black background而不是transparent ,如附图所示。

在此输入图像描述

how can I fix this? 我怎样才能解决这个问题? since the tool fails to create a transparent image, is it possible in .net to manipulate on the converted png image and make its background transparent? 由于该工具无法创建透明图像,.net中是否有可能在converted png image上进行操作并使其背景透明?

Current Code: 现行代码:

        //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 . 这是swf文件

I don't know much about SWFToImage. 我对SWFToImage不太了解。 But the company's web site contains demo code with the following comment (translated to C#): 但是该公司的网站上包含带有以下注释的演示代码(已转换为C#):

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

So possibly you have to change the order of your statements. 所以你可能需要改变你的陈述顺序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM