تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
نبدأ تقنيات الvb.net الخاصة(متجدد)
#3
PHP كود :
Imports System.Drawing.Imaging 


    
' Saves an image as a jpeg image, with the given quality  
    ' 
Gets
    
'   path   - Path to which the image would be saved. 
    '   
quality An integer from 0 to 100with 100 being the  
    
'           highest quality 
    Public Shared Sub SaveJpeg(ByVal path As String, ByVal img As Image, ByVal quality As Long) 
        If ((quality < 0) OrElse (quality > 100)) Then 
            Throw New ArgumentOutOfRangeException("quality must be between 0 and 100.") 
        End If 

        ' 
Encoder parameter for image quality 
        Dim qualityParam 
As New EncoderParameter(Encoder.Qualityquality
        
' Jpeg image codec  
        Dim jpegCodec As ImageCodecInfo = GetEncoderInfo("image/jpeg") 

        Dim encoderParams As New EncoderParameters(1) 
        encoderParams.Param(0) = qualityParam 
        img.Save(path, jpegCodec, encoderParams) 
    End Sub 



    ' 
Returns the image codec with the given mime type  
    
Private Shared Function GetEncoderInfo(ByVal mimeType As String) As ImageCodecInfo 
        
' Get image codecs for all image formats  
        Dim codecs As ImageCodecInfo() = ImageCodecInfo.GetImageEncoders() 

         Find the correct image codec  
        For i As Integer = 0 To codecs.Length - 1 
            If (codecs(i).MimeType = mimeType) Then 
                Return codecs(i) 
            End If 
        Next i 

        Return Nothing 
    End Function 

وهذا هو النداء
PHP كود :
Dim myImage As Image ' ... load the image somehow  
Save the image with a quality of 50%  
SaveJpeg(destImagePathmyImage50
microsoft partner
Team administrator
MCPD,MCITP,OCP,MP,MCC
Xprema Systems
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
نبدأ تقنيات الvb.net الخاصة(متجدد) - بواسطة smss - 20-09-12, 02:17 AM


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم