imageSX和imageXY的用法?

hucool 2004-12-24 05:22:19
imageSX和imageXY的用法?

谢谢!
...全文
346 10 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
hucool 2004-12-26
  • 打赏
  • 举报
回复
楼上的,测试结果出现以下提示:
Warning: Supplied argument is not a valid Image resource in c:\web\im.php on line 4
cokeyang 2004-12-25
  • 打赏
  • 举报
回复
imageSX()的参数是resource image

$im = @imagecreatefromgif ($imgname); /* Attempt to open */
<?
$img="262.gif";
$im = @imagecreatefromgif ($img);
echo imageSX($im);
//想显示出图片262.gif的宽度。
?>
hucool 2004-12-25
  • 打赏
  • 举报
回复
<?
$img="262.gif";
echo imageSX(getimagesize($img));
//想显示出图片262.gif的宽度。
?>
以上代码出现如下提示:

Warning: Supplied argument is not a valid Image resource in c:\web\im.php on line 4
hucool 2004-12-25
  • 打赏
  • 举报
回复
imagesize?还是getimagesize?
xuzuning 2004-12-25
  • 打赏
  • 举报
回复
imagesize
hucool 2004-12-25
  • 打赏
  • 举报
回复
有没有一个函数可以直接读取图片的高度和宽度!

比如说你有一个图片你跟本就不知道它的高和宽!用哪一个函数可以将其读出!?
spacet 2004-12-24
  • 打赏
  • 举报
回复
怎么配置:http://community.csdn.net/Expert/topic/3473/3473744.xml?temp=.205578
spacet 2004-12-24
  • 打赏
  • 举报
回复
很明显,你的GD库没有配置好
hucool 2004-12-24
  • 打赏
  • 举报
回复
我测试了这个
<?php

// create a 300*200 image
$img = imagecreate(300, 200);

echo imagesx($img); // 300

?>

结果在运行时出现如下提示:

Fatal error: Call to undefined function: imagecreate() in c:\web\im.php on line 4
spacet 2004-12-24
  • 打赏
  • 举报
回复
1、int imagesx ( resource image)

imagesx() 返回 image 所代表的图像的宽度。

例子 使用 imagesx()

<?php

// create a 300*200 image
$img = imagecreate(300, 200);

echo imagesx($img); // 300

?>

2、imagesy -- 取得图像高度

说明
int imagesy ( resource image)


imagesy() 返回 image 所代表的图像的高度。

例子 使用 imagesy()

<?php

// create a 300*200 image
$img = imagecreate(300, 200);

echo imagesy($img); // 200

?>

3、please read the manual!!!

21,893

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧