ASP 照片处理 - 列出照片颜色

发布于 2024-12-06 15:02:29 字数 105 浏览 1 评论 0原文

就像 Ruby (RMagicK) 中令人惊叹的“直方图”属性一样,它按频率顺序计算照片中的颜色列表 - 对于经典 ASP/.NET,是否有与此类似的第三方形式插件还是组件?

问候

Like the the amazing "histogram" property in Ruby (RMagicK), that computes a list of colors in a photo, in order of frequency - is there anything similar to this for Classic ASP/.NET, in the form of a third-party plugin or component?

Regards

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

晨曦÷微暖 2024-12-13 15:02:29

听起来 RMagick 是 ImageMagick 的衍生品。 Windows 版本有一个安装程序,允许您安装 COM 组件。 (您必须在安装程序中检查此项才能安装)。 链接

此 COM 组件可以在经典 ASP 中使用。

我有一些使用 ImageMagick 的经典 ASP 代码,语法有点不寻常。请注意,这不会单独起作用,因为它依赖于一些其他函数,但它会让您了解如何使用 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 文档将帮助您实现目标。

埃里克

It sounds like RMagick is a derivative of ImageMagick. The Windows version has an installer that allows you to install a COM component. (You will have to check this in the installer for it to be installed). Link

This COM component can be used from classic ASP.

I have some classic ASP code that uses ImageMagick, the syntax is a bit unusual. Please note that this won't function on its own, because it depends om some other functions, but it will give you an idea of how to use the COM component:

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

I don't know how to perform a histogram, but I hope this piece of code together with the imagemagick docs will get you there.

Erik

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文