Use the as function to draw an EMF file

Source: Internet
Author: User

-------- Thanks to the old man and Tao (this is called only the old man of the old man. Here, let me go, ), there is a good win. They are all cool people.

 

When I was just about to do this, I couldn't figure out where to start, even the EMF file and vector plot, and I didn't know what it was. The as plot function was useless at all, reading files in B/S mode is even more difficult. At that time, I thought about two directions: Convert the format on the browser side, or convert the format on the server side and send it again. According to the characteristics of FLEX, only JPG, PNG, and GIF images can be read,

Conversion from a browser to a server is difficult. It is also the final conversion to JPG, so it is more convenient to transfer it back on the server end. However, at that time, my head was filled with water. Naive thought that the client would read image data and then call a library SWC for conversion. Naive thinks that cross-compilation can be used to supplement the as plot function. in the end, I found that everything is naive and I don't want to face this problem (that is, I want to take a shortcut ). the older generation is right, and those who want to take shortcuts are often the longest.

However, I would like to summarize the cross-compilation section. Although there were detours, there were a lot of GAINS.

========================================================== ========================================================== ======

In this rugged process, I would like to thank the two friends who have always helped me. (Jumping, czcomt) is what the cool man says...

 

First, jumping told me to try the Open Source library, so I found cximage;

Later, czcomt told me that flash has a physical engine library, so I found cross-compilation, SWC, and a series of Flash function libraries.

 

At that time, I imagined that the cximage decoding library didn't use Windows APIs (indeed, the BMP Block didn't use APIs, but the EMF block used :(), then you can use cygwin + alchemy to compile the library into SWC and then embed it into SWF to convert the format. (Thanks to Jiji for providing guidance on cygwin many times ).

 

Well, at that time, I did not know whether the cximage decoding library really didn't use the API and did cross-compilation. In fact, I'm curious about Adobe's compilation of the Snake game into SWC, it turns out how C is used. It is true that the cross-compilation feature is very powerful, but it can only be used for pure logic. Since it is pure logic, there is no need to use cross. As is also very good for pure logic. However, it was silly at the time. I don't know that the platform is very dependent on the image display. Since the platform is required to be cross-platform, Apis cannot be used, that is, to display images, drawing Images cannot be implemented by SWC.

 

Provide the information you need in this process.

Cygwin usage:

Http://bbs.actionscript3.cn/viewthread.php? Tid = 20233 & page = 1 # pid176466

 

Alchemy Configuration:

Http://bbs.actionscript3.cn/viewthread.php? Tid = 20233 & page = 1 # pid176466

 

Alchemy calls API

Http: // 203.208.37.132/translate_c? Hl = ZH-CN & SL = ZH-tw & U = http://labs.adobe.com/wiki/index.php/Alchemy:Documentation:Developing_with_Alchemy:C_API&prev=/search%3Fq%3DAlchemy%2Bgcc%2Bubuntu%26hl%3Dzh-CN%26sa%3DG%26newwindow%3D1&rurl=translate.google.cn&usg=ALkJrhgGRp8ick3-rkVnL49WU9RIzNbW7g

Official cximage Information

Http://www.codeproject.com/KB/graphics/cximage.aspx

 

At this point, I read the WMF IN THE cximage decoding library.CodeThen, I was desperate and used several win APIs. That is to say, the previous efforts are in vain. A third-party library is not a feasible solution, or it should be said that a third-party non-browser language cannot work. Platform dependency issues. however, I didn't give up yet, but I was overjoyed to see OOO display EMF images on Linux. I saw that the libemf library is used in Ooo, and the function simulation in it is windows. It can run on Linux, FreeBSD, and UNIX, but it cannot be ruled out that it uses APIs from other platforms, you need to know that most of the platform-related issues cannot be cross-located. In this way, the third non-Flex library is disconnected, while the third-party flex library has not read EMF. Therefore, it is impossible to take a shortcut. We need to analyze the image information a little bit, read the data in it, and draw it using the as drawing function.

 

Now, an EMF image has been initially drawn, and the rest is focused on interpreting data for each GDI function and function simulation. This part of the summary will be done after you understand EMF, SwF, WMF, RGB color table, vector drawing, and color palette.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.