태터데스크 관리자

도움말
닫기
적용하기   첫페이지 만들기

태터데스크 메시지

저장하였습니다.
페이지를 읽고 있습니다. ( 아쿠아바다's Blog )
분류 전체보기 (769)
쉐어포인트 (24)
Exchange (12)
SQL (121)
XML (36)
WEB (294)
O / S (97)
삶의향기 (162)
기획 (19)
RSS 피드(IE 7.0부터 기본 지원됩니다. 이전 버전 사용자는 접합한 툴을 사용하세요!!)

이미지 넓이, 높이 알아내기

WEB/ASP / DotNet 2007/06/07 18:00 by 아쿠아바다

<%
IMG_file = server.mappath(".") & "\box.jpg"
imag_size = ImgFunction(IMG_file)
imag_size = Split(imag_size,",")
response.write ("넓이 " & imag_size(0))
response.write "<br>"
response.write ("높이 " & imag_size(1))
%>


---------------------------------------------------

출력화면


넓이 213
높이 114




--------------------------------------------------------

<%
Function ImgFunction(IMG_file)
Const limitWidth=600
dim orgWidth,orgHeight
dim newWidth,newHeight

Set objImg = LoadPicture(IMG_file)
orgWidth = cint(objImg.Width * 24 / 635)
orgHeight = cint(objImg.Height * 24 / 635)
if limitWidth < orgWidth then
  newWidth = limitWidth
  newHeight = orgHeight * (limitWidth / orgWidth)
else
  newWidth = orgWidth
  newHeight = orgHeight
End if
ImgFunction = orgWidth & "," & orgHeight
End Function
%>


자바스크립트

var img = new Image()

    img.src="경로";

    alert(img.width);

좀더 흥미로운 내용이 많이 있습니다.. HOME > WEB/ASP / DotNet를 확인하세요
TAG ,   
0 Trackback, 0 Comment, :
1  ... 265 266 267 268 269 270 271 272 273  ... 769 
Statistics Graph
Total : 557,403 Today : 33