search
Homephp教程php手册为php4加入动态flash文件的生成的支持

想象过在网站上动态生成flash动画吗,本文就让你步入php+flash的激动时代。

php真是个好东西呀,真是无法预料她明天会变的怎样。。。好了,言归正传,下面

介绍怎样实现这个功能。

一、需要的软件

swf的支持库

http://reality.sgi.com/grafica/flash/dist.99.linux.tar.Z

这个包里面有文档,你可以用c来使用它,他的例子就是。

这哥们太好了,不过他要是提供源码就更好了。

还有当然是php4了从http://www.php.net得到

二、安装

1、libswf.a安装

#cp dist.99.linux.tar.Z /usr/local

#tar xvzf dist.99.linux.tar.Z

#cd dist

#make

你会看到例子c程序生成的image.swf和test.swf两个文件,你可以放到浏览器看看结果。

如果出来了,你就完成一半了。

你还需要做一些事情

在/etc/profile中加入

SWFBINPATH=/usr/local/dist/bin

export SWFBINPATH

SWFFONTPATH=/usr/local/dist/fonts

export SWFFONTPATH

2、编译php4

编译加入

--with-swf=/usr/local/dist

笔者在编译的时候发现找不到swf.h错误,用

#cp /usr/local/dist/swf.h /php/src/directory/ext/swf解决问题

安装完后做个如下的脚本(php文档带的例子),请注意当前目录下的swf目录要可

写,不然apache会出错的你什么都会的不到的

执行完后用浏览器调用test.swf文件,你肯定会很惊讶php的威力,呵呵

体会一下程序设计和艺术设计的完美感觉吧,可惜我没有艺术头脑:-(

在/usr/local/dist/bin中有两个程序,imgtofi用来转化rgb,gif,jpg到libswf.a支持的

图形格式,pstoff为把ps字体转化为libswf.a可用的字体,我转化过英文字体,能在程序

中使用,但是没转化成功过中文字体,不知道哪位大虾成功了,能否告之一下。

关于swf的php函数说明,请去php.net找最新的manual。 



Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.