FreeImage Usage

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

Usage:

======

Both a procedural and an OO API is provided. eg.

Procedural:

-----------

<?php

printf("FreeImage Version %s<br>%s<br><br>", FreeImage_GetVersion(), FreeImage_GetCopyrightMessage());

for ($i=0; $i<FreeImage_GetFIFCount(); $i++) {

printf("<b>Bitmap type %d:</b> <u>%s</u> (%s)<br>", $i, FreeImage_GetFIFDescription($i), FreeImage_GetFIFExtensionList($i));

echo str_repeat('&nbsp;', 17);

if (FreeImage_FIFSupportsReading($i)) {

echo 'Read: <font color="green"><b>OK</b></font>';

} else {

echo 'Read: <font color="red"><b>FAILURE</b></font>';

}

if (FreeImage_FIFSupportsWriting($i)) {

echo ' - Write: <font color="green"><b>OK</b></font><br>';

} else {

echo ' - Write: <font color="red"><b>FAILURE</b></font><br>';

}

}

?>

OO:

---

<?php

$fi = new FreeImage();

printf("FreeImage Version %s<br>%s<br><br>", $fi->GetVersion(), $fi->GetCopyrightMessage());

for ($i=0; $i<$fi->GetFIFCount(); $i++) {

printf("<b>Bitmap type %d:</b> <u>%s</u> (%s)<br>", $i, $fi->GetFIFDescription($i), $fi->GetFIFExtensionList($i));

echo str_repeat('&nbsp;', 17);

if ($fi->FIFSupportsReading($i)) {

echo 'Read: <font color="green"><b>OK</b></font>';

} else {

echo 'Read: <font color="red"><b>FAILURE</b></font>';

}

if ($fi->FIFSupportsWriting($i)) {

echo ' - Write: <font color="green"><b>OK</b></font><br>';

} else {

echo ' - Write: <font color="red"><b>FAILURE</b></font><br>';

}

}

?>

You can see some other various samples in the "examples/" directory.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航