• وبلاگ : پاي سيب
  • يادداشت : بازي هاي موبايل با فرمت جاوا
  • نظرات : 0 خصوصي ، 78 عمومي

  • نام:
    ايميل:
    سايت:
       
    متن پيام :
    حداکثر 2000 حرف
    كد امنيتي:
      
      
     
    + اميرحسين 
    Public Function img_resize(ByVal picname As String,ByVal maxHeight As Integer, ByVal maxWidth As Integer) As String
    Dim currentImage As System.Drawing.Image = System.Drawing.Image.FromFile(server.mappath("mypics\") + picname)
    Dim imgHeight, imgWidth As Integer
    imgHeight = currentImage.Height
    imgWidth = currentImage.Width
    If imgWidth > maxWidth Or imgHeight > maxHeight Then
    "Determine what dimension is off by more
    Dim deltaWidth As Integer = imgWidth - maxWidth
    Dim deltaHeight As Integer = imgHeight - maxHeight
    Dim scaleFactor As Double
    If deltaHeight > deltaWidth Then
    "Scale by the height
    scaleFactor = maxHeight / imgHeight
    Else
    "Scale by the Width
    scaleFactor = maxWidth / imgWidth
    End If
    imgWidth *= scaleFactor
    imgHeight *= scaleFactor
    End If
    Dim html As String
    html = "<img src=""" + mydir + picname + """ height=""" & imgHeight & """ width=""" & imgWidth & ">"""
    Return html