|
|
|
ขอถามเรื่องการสร้างimageจากcode asp ทำได้มั้ยครับ ขอcodeการสร้างรูปภาพหน่อยครับ |
|
|
|
|
|
|
|
ถ้าใช้ php ได้บนเครื่อง ให้ไปโหลด phpthumb มาใช้ครับ ง่ายกว่า
|
|
|
|
|
Date :
2009-06-25 18:19:40 |
By :
mr.v |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (ASP)
<%
Option Explicit
Dim Chs, objConst,NewWidth,NewHeight
Dim FileName,OutFormat
FileName = "mygirl.jpg"
OutFormat = "Jpg" '*** Gif,Png ***'
NewWidth = "100" '*** Set new Width , Height automatic caculate ***'
NewHeight = 0 '*** Auto Resize ***'
'*** Get Images Width & Height ***'
Dim objFso,myImg,Width,Height
Set objFso = CreateObject("Scripting.FileSystemObject")
IF objFso.FileExists(Server.MapPath(FileName)) Then
set myImg = Loadpicture(Server.MapPath(FileName))
Width = Round(myImg.width / 26.4583)
Height = Round(myImg.height / 26.4583)
NewHeight = Round((NewWidth*Height)/Width)
'NewHeight = 100
'NewWidth = Round((NewHeight*Width)/Height) '*** or Automatic Height ***'
End If
'*************** End *************'
Set Chs = Server.CreateObject("OWC10.ChartSpace")
Set objConst = Chs.Constants
Chs.Interior.SetTextured Server.MapPath(FileName), objConst.chStretchPlot, , objConst.chAllFaces
Chs.border.color = -3
Response.BinaryWrite Chs.GetPicture(OutFormat, NewWidth, NewHeight)
Set objConst = Nothing
Set Chs = Nothing
%>
Go to : ASP Resize Image
|
|
|
|
|
Date :
2011-06-09 21:27:35 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|