2011-09-27 32 views
0

像Ruby(RMagicK)中令人驚歎的「直方圖」屬性一樣,按照頻率的順序計算照片中的顏色列表 - 對於Classic ASP /有沒有類似的內容。 NET,以第三方插件或組件的形式?ASP照片處理 - 列表照片顏色

Regards

回答

1

聽起來像RMagick是ImageMagick的衍生物。 Windows版本有一個安裝程序,允許您安裝COM組件。 (您必須在安裝程序中檢查它是否已安裝)。 http://www.imagemagick.org/script/binary-releases.php?ImageMagick=8cvbummutopc2abqtaafa0bu66#windows

此COM組件可以使用從傳統的ASP。

我有一些使用ImageMagick的經典ASP代碼,語法有點不同尋常。請注意,這不會對自己的工作,因爲它取決於OM一些其他的功能,但它會給你如何使用COM組件的想法:

function DrawPoly(destFile, coordinates, fillcolor, strokecolor) 
    ' Draws a single polygon and returns a result-image 
    Dim img: Set img = CreateObject("ImageMagickObject.MagickImage.1") 
    dim polygon, DrawCommand, DrawResult 
     polygon = trim(coordinates) 
     polygon = normalizeCoordinates(polygon,10) 
     DrawCommand = "polygon " & trim(polygon) 
     DrawResult = img.Convert(Server.Mappath(destFile), "-matte", "-fill", fillColor, "-stroke", strokeColor, "-draw", DrawCommand, Server.Mappath(destFile)) 
     If Err.Number <> 0 Then Response.Write(Err.Number & ": " & Err.Description & vbCrLf & msgs) 
    DrawPoly = destFile 
    Set img = nothing 
end function 

我不知道如何執行一個直方圖,但我希望這段代碼與imagemagick文檔一起會讓你在那裏。

Erik