[心缘地方]同学录
首页 | 功能说明 | 站长通知 | 最近更新 | 编码查看转换 | 代码下载 | 常见问题及讨论 | 《深入解析ASP核心技术》 | 王小鸭自动发工资条VBA版
登录系统:用户名: 密码: 如果要讨论问题,请先注册。
发表人 主题:怎样修改缩略图的尺寸大小?
hayfeng
身份:user
发帖:80
登陆次数:72
1F 发表于 2007/4/29 22:28:30
缩略图尺寸的大小如果我要改成上传图片后自动生成缩略图的宽度290,高度148,怎么改?是不是单单只修改photo_savephoto.asp页面的代码就可以了,其他页面要改么?怎么改?


''--------缩略图---------------------------
            select case ReSizeUse
            case "AspJpeg"
                Set Jpeg = Server.CreateObject("Persits.Jpeg")
                Path = Server.MapPath(formPath&filename)
                Jpeg.Open Path
                jpeg.PreserveAspectRatio = True
                ''比例缩放
                if Jpeg.OriginalWidth/Jpeg.OriginalHeight>160/120 then
                    if Jpeg.OriginalWidth>160 Then
                        Jpeg.Width = 160
                    Else
                        Jpeg.Width=Jpeg.OriginalWidth
                    End if
                else
                    if Jpeg.OriginalHeight>120 Then
                        Jpeg.Height=120
                    Else
                        Jpeg.Height=Jpeg.OriginalHeight
                    End if
                end if
                Jpeg.Save Server.MapPath(formPath & "small/small_" & filename)
            case "wsImage"
                set wsImage=Server.CreateObject("wsImage.Resize")
                Path = Server.MapPath(formPath&filename)
                wsImage.LoadSoucePic Path
                wsImage.GetSourceInfo OriginalWidth,OriginalHeight ''取得图片宽度和高度
                wsImage.Quality=80 ''质量80%
                ''比例缩放
                if OriginalWidth/OriginalHeight>160/120 then
                    if OriginalWidth>160 Then
                        newWidth = 160
                    Else
                        newWidth=OriginalWidth
                    End if
                    ''指定宽度缩放,高度自动缩放
                    wsImage.OutputSpic Server.MapPath(formPath & "small/small_" & filename),newWidth,0,1
                else
                    if OriginalHeight>120 Then
                        newHeight=120
                    Else
                        newHeight=OriginalHeight
                    End if
                    ''指定高度缩放,宽度自动缩放
                    wsImage.OutputSpic Server.MapPath(formPath & "small/small_" & filename),0,newHeight,2
                end if
                wsImage.free
                set wsImage=nothing
            end select
            '=========添加文件的信息到数据库里,默认没有锁定=====
            myIndex=right(formName,1)
            temp_photoTitle=upload.form("photoTitle"+myIndex)
            temp_photoIntro=upload.form("photoIntro"+myIndex)
            temp_photoWidth=upload.form("photoWidth"+myIndex)
            temp_photoHeight=upload.form("photoHeight"+myIndex)
            '========检查输入,为空则给初值===
            temp_photoTitle=replace(trim(temp_photoTitle),"'","''")
            if temp_photoTitle="" then
                temp_photoTitle="没有填写"
            end if
            temp_photoIntro=replace(trim(temp_photoIntro),"'","''")
            if temp_photoIntro="" then
                temp_photoIntro="没有填写"
            end if
            if temp_photoWidth="" or not IsNumeric(temp_photoWidth) then
                temp_photoWidth=160
            end if
            if temp_photoHeight="" or not IsNumeric(temp_photoHeight) then
                temp_photoHeight=120
            end if




嘎嘎,是我
身份:admin
发帖:1435
登陆次数:3217
2F 发表于 2007/4/29 22:56:23
对的…………

其他显示缩略图的页面的<img 标签的width和height也得改。

hayfeng
身份:user
发帖:80
登陆次数:72
3F 发表于 2007/4/29 22:58:50
我是指要把首页自动生成的缩略图改成宽度290,高度148哦,具体要改哪几个页面?还有要改哪个地方?

嘎嘎,是我
身份:admin
发帖:1435
登陆次数:3217
4F 发表于 2007/4/30 20:05:12
就是你说的那样改……

index.asp和photo_listphoto.asp,你就搜索160,120,改了就完了。

自己看着改吧…………不能啥事我都帮你做呀。

 
标题:
消息图标:                                             
                                            
正文:



* UBB 代码开启

 
CopyRight © 心缘地方 2005-2999. All Rights Reserved