首页 技术教程 实用代码 注册破解 正则表达式 网址导航 电子书籍

生成缩略图及给原始图加水印

using System.IO; using System.Drawing.Imaging; private void Button1_ServerClick(object sender, System.EventArgs e) { Graphics g=null; System.Drawing.Image upimage=null; System.Drawing.Image thumimg=null; System.Drawing.Image simage=null; Bitmap outputfile=null; try { string extension = Path.GetExtension(File1.PostedFile.FileName).ToUpper(); string filename = DateTime.Now.ToString("yyyyMMddhhmmss"); string smallpath = Server.Ma...
类别:网页编程 - ASP.NET    查看:115    更新:2014-05-20

PHP用流方式制作缩略图

其中db_mysql.inc.php,config.php,function.php不是真正使用到的,关键是$filename 文件名,我是通过读取数据库中的图片名称。 以下是PHP代码:【复制代码】 <?phpinclude_once ('inc/db_mysql.inc.php');include_once ('inc/config.php');include_once ('class/function.php');global $picPath; if (strstr($_SERVER[HTTP_USER_AGENT],"MSIE")) {$attachment = '';} else {$attachment = ' atachment;';} $image = getInfo('newssp_gallery','id',$_GET['id']); $filename = $picPath.$image['filename']; if (!file_exists($filename)) {$filename = $picPath."notexist.gif...
类别:网页编程 - PHP技术    查看:87    更新:2014-05-19

兼容性最强的PHP生成缩略图的代码

写通用性程序考虑兼容性是很头痛的事情,关于用PHP生成缩略图的代码很多,不过能完全兼容gd1.6和gd2.x,并能保证缩图清晰性的代码几乎没有,我把我以前的代码改了一下,就能实现了。 function ImageResize($srcFile,$toW,$toH,$toFile="")  {    if($toFile==""){ $toFile = $srcFile; }    $info = "";    $data = GetImageSize($srcFile,$info);    switch ($data[2])     {     case 1:     ...
类别:网页编程 - PHP技术    查看:79    更新:2014-05-19