亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

ASPJPEG綜合操作CLASS

系統 1965 0

<%
'ASPJPEG綜合操作CLASS
'Authour: tony 05/09/05
Class AspJpeg
Dim AspJpeg_Obj,obj
Private Img_MathPath_From,Img_MathPath_To,Img_Reduce_Size,CoverIf
Private Img_Frame_Size,Img_Frame_Color,Img_Frame_Solid,Img_Frame_Width,Img_Frame_Height
Private Img_Font_Content,Img_Font_Family,Img_Font_Color,Img_Font_Quality,Img_Font_Size,Img_Font_Bold,Img_Font_X,Img_Font_Y
Private Img_PicIn_Path,Img_PicIn_X,Img_PicIn_Y
'--------------取原文件路徑
Public Property Let MathPathFrom(StrType)
Img_MathPath_From=StrType
End Property

'--------------取文件保存路徑
Public Property Let MathPathTo(strType)
Img_MathPath_To=strType
End Property

'--------------保存文件時是否覆蓋已有文件
Public Property Let CovePro(LngSize)
If LngSize=0 or LngSize=1 or LngSize=true or LngSize=false then
CoverIf=LngSize
End If
End Property

'---------------取縮略圖/放大圖 縮略值
Public Property Let ReduceSize(LngSize)
If isNumeric(LngSize) then
Img_Reduce_Size=LngSize
End If
End Property

'---------------取描邊屬性
'邊框粗細
Public Property Let FrameSize(LngSize)
If isNumeric(LngSize) then
Img_Frame_Size=Clng(LngSize)
End If
End Property
'邊框寬度
Public Property Let FrameWidth(LngSize)
If isNumeric(LngSize) then
Img_Frame_Width=Clng(LngSize)
End If
End Property
'邊框高度
Public Property Let FrameHeight(LngSize)
If isNumeric(LngSize) then
Img_Frame_Height=Clng(LngSize)
End If
End Property
'邊框顏色
Public Property Let FrameColor(strType)
If strType<>"" then
Img_Frame_Color=strType
End If
End Property
'邊框是否加粗
Public Property Let FrameSolid(LngSize)
If LngSize=1 or LngSize=0 or LngSize=true or LngSize=false then
Img_Frame_Solid=LngSize
End If
End Property

'---------------取插入文字屬性
'插入的文字
Public Property Let Content(strType)
If strType<>"" then
Img_Font_Content=strType
End If
End Property
'文字字體
Public Property Let FontFamily(strType)
If strType<>"" then
Img_Font_Family=strType
End If
End Property
'文字顏色
Public Property Let FontColor(strType)
If strType<>"" then
Img_Font_Color=strType
End If
End Property
'文字品質
Public Property Let FontQuality(LngSize)
If isNumeric(LngSize) then
Img_Font_Quality=Clng(LngSize)
End If
End Property
'文字大小
Public Property Let FontSize(LngSize)
If isNumeric(LngSize) then
Img_Font_Size=Clng(LngSize)
End If
End Property
'文字是否加粗
Public Property Let FontBold(LngSize)
If LngSize=1 or LngSize=0 or LngSize=true or LngSize=false then
Img_Font_Bold=LngSize
End If
End Property
'輸入文字的X坐標
Public Property Let FontX(LngSize)
If isNumeric(LngSize) then
Img_Font_X=Clng(LngSize)
End If
End Property
'輸入文字的Y坐標
Public Property Let FontY(LngSize)
If isNumeric(LngSize) then
Img_Font_Y=Clng(LngSize)
End If
End Property

'---------------取插入圖片屬性
'插入圖片的路徑
Public Property Let PicInPath(strType)
Img_PicIn_Path=strType
End Property
'圖片插入的X坐標
Public Property Let PicInX(LngSize)
If isNumeric(LngSize) then
Img_PicIn_X=Clng(LngSize)
End If
End Property
'圖片插入的Y坐標
Public Property Let PicInY(LngSize)
If isNumeric(LngSize) then
Img_PicIn_Y=Clng(LngSize)
End If
End Property



Private Sub Class_Initialize()
Set AspJpeg_Obj=createObject("Persits.Jpeg")
Img_MathPath_From=""
Img_MathPath_To=""
Img_Reduce_Size=150
Img_Frame_Size=1
'Img_Frame_Width=0
'Img_Frame_Height=0
'Img_Frame_Color="&H000000"
'Img_Frame_Bold=false
Img_Font_Content="GoldenLeaf"
'Img_Font_Family="Arial"
'Img_Font_Color="&H000000"
Img_Font_Quality=3
Img_Font_Size=14
'Img_Font_Bold=False
Img_Font_X=10
Img_Font_Y=5
'Img_PicIn_X=0
'Img_PicIn_Y=0
CoverIf=1

End Sub
Private Sub Class_Terminate()
Err.Clear
Set AspJpeg_Obj=Nothing
End Sub
'判斷文件是否存在
Private Function FileIs(path)
Set fsos=Server.createObject("Scripting.FileSystemObject")
FileIs=fsos.FileExists(path)
Set fsos=Nothing
End Function

'判斷目錄是否存在
Private Function FolderIs(path)
Set fsos=Server.createObject("Scripting.FileSystemObject")
FolderIs=fsos.FolderExists(path)
Set fsos=Nothing
End Function
'*******************************************
'函數作用:取得當前文件的上一級路徑
'*******************************************
Private Function UpDir(ByVal D)
If Len(D) = 0 then
UpDir=""
Else
UpDir=Left(D,InStrRev(D,"\")-1)
End If
End Function

Private Function Errors(Errors_id)
select Case Errors_id
Case "0"
Errors="指定文件不存在"
Case 1
Errors="指定目錄不存在"
Case 2
Errors="已存在相同名稱文件"
Case 3
Errors="參數溢出"
End select
End Function


'取圖片寬度
Public Function ImgInfo_Width(Img_MathPath)
If Not(FileIs(Img_MathPath)) then
'Exit Function
ImgInfo_Width=Errors(0)
Else
AspJpeg_Obj.Open Img_MathPath
ImgInfo_Width=AspJpeg_Obj.width
End If
End Function
'取圖片高度
Public Function ImgInfo_Height(Img_MathPath)
If Not(FileIs(Img_MathPath)) then
'Exit Function
ImgInfo_Height=Errors(0)
Else
AspJpeg_Obj.Open Img_MathPath
ImgInfo_Height=AspJpeg_Obj.height
End If
End Function
'生成縮略圖/放大圖
Public Function Img_Reduce()
If Not(FileIs(Img_MathPath_From)) then
Img_Reduce=Errors(0)
Exit Function
End If
If Not(FolderIs(UpDir(Img_MathPath_To))) then
Img_Reduce=Errors(1)
Exit Function
End If
If CoverIf=0 or CoverIf=False then
If FileIs(Img_MathPath_To) then
Img_Reduce=Errors(2)
Exit Function
End If
End If
AspJpeg_Obj.Open Img_MathPath_From
AspJpeg_Obj.PreserveAspectRatio = True
If AspJpeg_Obj.OriginalWidth>AspJpeg_Obj.OriginalHeight Then
AspJpeg_Obj.Width=Img_Reduce_Size
Else
AspJpeg_Obj.Height=Img_Reduce_Size
End If
If AspJpeg_Obj.OriginalWidth>Img_Reduce_Size or AspJpeg_Obj.OriginalHeight>Img_Reduce_Size Then
If AspJpeg_Obj.Width<Img_Reduce_Size or AspJpeg_Obj.Height<Img_Reduce_Size then
Set AspJpeg_Obj_New=createObject("Persits.Jpeg")
AspJpeg_Obj_New.new Img_Reduce_Size,Img_Reduce_Size,&HFFFFFF
AspJpeg_Obj_New.DrawImage (150-AspJpeg_Obj.width)/2,(150-AspJpeg_Obj.height)/2,AspJpeg_Obj
If Img_Frame_Size>0 then
Call Img_Pen(AspJpeg_Obj_New)
End If
If Img_Font_Content<>"" then
Img_Font_X=AspJpeg_Obj_New.Width/2
Img_Font_Y=AspJpeg_Obj_New.Height-15
Call Img_Font(AspJpeg_Obj_New)
End If
AspJpeg_Obj_New.Sharpen 1, 130
AspJpeg_Obj_New.Save Img_MathPath_To
Set AspJpeg_Obj_New=Nothing
Else
If Img_Frame_Size>0 then
Call Img_Pen(AspJpeg_Obj)
End If
If Img_Font_Content<>"" then
Img_Font_X=AspJpeg_Obj.Width/2
Img_Font_Y=AspJpeg_Obj.Height-15
Call Img_Font(AspJpeg_Obj)
End If
AspJpeg_Obj.Sharpen 1, 130
AspJpeg_Obj.Save Img_MathPath_To
End If
Else
If Img_Frame_Size>0 then
Call Img_Pen(AspJpeg_Obj)
End If
If Img_Font_Content<>"" then
Img_Font_X=AspJpeg_Obj.Width/2
Img_Font_Y=AspJpeg_Obj.Height-15
Call Img_Font(AspJpeg_Obj)
End If
AspJpeg_Obj.Sharpen 1, 130
AspJpeg_Obj.Save Img_MathPath_To
End If
End Function
'生成水印
Public Function Img_WaterMark()
If Not(FileIs(Img_MathPath_From)) then
Img_WaterMark=Errors(0)
Exit Function
End If
If Img_MathPath_To="" then
Img_MathPath_To=Img_MathPath_From
ElseIf Not(FolderIs(UpDir(Img_MathPath_To))) then
Img_WaterMark=Errors(1)
Exit Function
End If
If CoverIf=0 or CoverIf=false then
If Img_MathPath_To<>Img_MathPath_From and FileIs(Img_MathPath_To) then
Img_WaterMark=Errors(2)
Exit Function
End If
End If
AspJpeg_Obj.Open Img_MathPath_From
If Img_PicIn_Path<>"" then
If Not(FileIs(Img_PicIn_Path)) then
Img_WaterMark=Errors(0)
Exit Function
End If
Set AspJpeg_Obj_New=createObject("Persits.Jpeg")
AspJpeg_Obj_New.Open Img_PicIn_Path
AspJpeg_Obj.PreserveAspectRatio = True
AspJpeg_Obj_New.PreserveAspectRatio = True
If AspJpeg_Obj.OriginalWidth<Img_Reduce_Size or AspJpeg_Obj.OriginalHeight<Img_Reduce_Size then
Img_WaterMark=Errors(3)
Exit Function
End If
If AspJpeg_Obj_New.OriginalWidth>AspJpeg_Obj_New.OriginalHeight Then
AspJpeg_Obj_New.Width=Img_Reduce_Size
Else
AspJpeg_Obj_New.Height=Img_Reduce_Size
End If
If Img_PicIn_X="" then Img_PicIn_X=AspJpeg_Obj.Width-AspJpeg_Obj_New.Width
If Img_PicIn_Y="" then Img_PicIn_Y=AspJpeg_Obj.Height-AspJpeg_Obj_New.Height
AspJpeg_Obj.DrawImage Img_PicIn_X,Img_PicIn_Y,AspJpeg_Obj_New
Set AspJpeg_Obj_New=Nothing
End If
If Img_Frame_Size>0 then
Call Img_Pen(AspJpeg_Obj)
End If
If Img_Font_Content<>"" then
Call Img_Font(AspJpeg_Obj)
End If
'AspJpeg_Obj.Sharpen 1, 130
AspJpeg_Obj.Save Img_MathPath_To
End Function
'生成框架
Private Function Img_Pen(Obj)
If Img_Frame_Width=0 then Img_Frame_Width=Obj.Width
If Img_Frame_Height=0 then Img_Frame_Height=Obj.Height
Obj.Canvas.Pen.Color = Img_Frame_Color
Obj.Canvas.Pen.Width = Img_Frame_Size
Obj.Canvas.Brush.Solid = Img_Frame_Solid
Obj.Canvas.Bar 1,1,Img_Frame_Width,Img_Frame_Height
End Function
'生成水印字
Private Function Img_Font(Obj)
Obj.Canvas.Font.Color = Img_Font_Color
Obj.Canvas.Font.Family = Img_Font_Family
Obj.Canvas.Font.Quality=Img_Font_Quality
Obj.Canvas.Font.Size=Img_Font_Size
Obj.Canvas.Font.Bold = Img_Font_Bold
Obj.Canvas.Print Img_Font_X,Img_Font_Y,Img_Font_Content
End Function
End Class

%>

from

其他文章:

用ASPJPEG組件制作圖片的縮略圖和加水印

在VC中使用 Flash 美化你的程序

獲得WebBrowser控件中的HTML源碼

使用IE控件的一些有趣方法

為Pocket PC上的IE創建ActiveX控件

ASP服務器端組件編程實例1

aspjpeg組件高級使用方法介紹

用AspJpeg組件,按寬高比例,真正生成縮略圖


google_ad_client = "pub-2416224910262877"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_channel = ""; google_color_border = "FFFFFF"; google_color_bg = "FFFFFF"; google_color_link = "0000FF"; google_color_text = "000000"; google_color_url = "008000";

ASPJPEG綜合操作CLASS


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 久久婷婷成人综合色 | 老司机午夜影院 | 小说区图片区综合久久亚洲 | 日韩中文精品亚洲第三区 | 精品日产一区二区三区手机 | 男人的网站在线观看 | 人人97| 中国国产成人精品久久 | 中国特黄特级真人毛片 | 色偷偷精品视频在线播放 | 九九99热久久国产 | 在线黄色.com | 欧美视频成人 | 欧美日本一本线在线观看 | 4huh34四虎最新久 | 伊在人亚洲香蕉精品区麻豆 | 国产伦一区二区三区免费 | 九九热最新| 午夜一级精品免费毛片 | 欧美日韩久久 | 国产精品久久久久999 | 天天操夜夜操夜夜操 | 国产伦精品一区二区三区 | 色综合色狠狠天天久久婷婷基地 | 久久成人永久免费播放 | 亚洲欧美日韩精品久久 | 国内精品久久久久激情影院 | 日本成人毛片 | 欧美夜夜操| 91在线看片 | 久久国产精品免费视频 | 久久青青视频 | 成人免费视频网站 | 在线观看一级毛片 | 欧美日韩网站 | 国产动作大片中文字幕 | 奇米影视第 | 久久99视频精品 | 综合7799亚洲伊人爱爱网 | 波多野结衣视频一区 | 国产色视频一区 |