Difference between revisions of "PascalMagick/zh CN"

From Lazarus wiki
Jump to navigationJump to search
 
Line 5: Line 5:
 
==== 关于 ImageMagick ====
 
==== 关于 ImageMagick ====
  
 +
[http://www.imagemagick.org ImageMagick]套件是一款免费的软件,用来开发、创建、编辑和组合位图图像。它支持大量不同格式的图像(超过90种),包括格式如GIF、JPEG、PNG、JPEG2000 、PDF、PhotoCD、TIFF、DPX。图像可以剪裁、颜色改变,可以使用各种效果,图像可以旋转,组合文本、线、多边形、椭圆和贝塞尔曲线,可以添加图片,拉伸或旋转。
  
[http://www.imagemagick.org ImageMagick] is a free software suite developed to create, edit, and compose bitmap images. It supports a huge variety of formats (over 90) including formats like GIF, JPEG, JPEG-2000, PNG, PDF, PhotoCD, TIFF, and DPX. Images can be cropped, colors can be changed, various effects can be applied, images can be rotated and combined, and text, lines, polygons, ellipses and Bézier curves can be added to images and stretched and rotated.
+
该套件运行在所有主流操作系统上,也可在命令行中使用,它的命令行工具也是Linux标准套件之一,在多个发行版中。
 
 
The suite runs on all major operating systems and it can also be used from the command line and it´s command line tools package is one of Linux standard packages, being distributed with many distributions.
 
  
 
特性和功能:
 
特性和功能:
  
* Convert an image from one format to another (e.g. PNG to JPEG)
+
*图像格式转换(如JPEG到PNG等等)
* Resize, rotate, sharpen, color reduce, or add special effects to an image
+
*改变大小、旋转、锐化、颜色减少,为图像增加特效
* Create a montage of image thumbnails
+
*创建剪贴画
* Create a transparent image suitable for use on the Web
+
*创建无背景图像
* Turn a group of images into a GIF animation sequence
+
*将一组图片变成GIF动画
* Create a composite image by combining several separate image
+
*创建合成图像
* Draw shapes or text on an image
+
*画形状或文本在图像上
* Decorate an image with a border or frame
+
*修饰图像边框或框架
* Describe the format and characteristics of an image
+
*描述图像的格式和特点
  
 
==== ImageMagick 书籍 ====
 
==== ImageMagick 书籍 ====
  
[http://www.packtpub.com/imagemagick/book ImageMagick Tricks] This fast paced and practical tutorial is packed with examples of photo manipulations, logo creation, animations, and complete web projects. With this book up your sleeve, you'll be creating spellbinding images from code in no time.
+
[http://www.packtpub.com/imagemagick/book ImageMagick 技巧] 这种快节奏的实用教程中包含了大量照片处理的例子,创建LOGO、动画及完整的WEB项目。有了这本袖珍书,你会在任何时间创建出引人入胜的图像。
  
 
==== 关于 MagickWand ====
 
==== 关于 MagickWand ====
  
 
+
[http://www.imagemagick.org/script/magick-wand.php MagickWand API] 是ImageMagick 团队推荐的接口,它是一个易于使用的编程接口。
The [http://www.imagemagick.org/script/magick-wand.php MagickWand API] is the recommended interface by the ImageMagick team. It is an easy to use programming interface for using the suite.
 
  
 
==== 关于 MagickCore ====
 
==== 关于 MagickCore ====
  
The MagickCore API is a low-level interface for ImageMagick.
+
该MagickCore API是​​ImageMagick的一个低级别接口。
  
 
==== 关于 PascalMagick ====
 
==== 关于 PascalMagick ====
  
 
This port is a translation of the c header files for both MagickWand and Magick Core.
 
This port is a translation of the c header files for both MagickWand and Magick Core.
 +
<strike>此端口是C头文件的MagickWand 和Magick 核心翻译。</strike>
  
  
Line 53: Line 52:
 
BSD-style and compatible with the GPL.
 
BSD-style and compatible with the GPL.
  
You can read the Licence [http://www.imagemagick.org/script/license.php here].
+
你可以 [http://www.imagemagick.org/script/license.php 阅读授权].
  
 
=== 下载 ===
 
=== 下载 ===
{{Note|PascalMagick is included in all recent FPC releases. There is no need to download it}}
+
{{Note|PascalMagick已经包含在所有最近的FPC版本中,你不需要下载它。}}
  
 
==== 旧的版本 ====
 
==== 旧的版本 ====
PascalMagick 0.4 is available here: http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=174103&release_id=431432
+
PascalMagick 0.4 可以在这里找到: http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=174103&release_id=431432
  
For old FPC versions, you can download the subversion version of this project using this command:
+
对于旧版本的FPC,以使用下面的命令下载项目:
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
 +
<b>地址失效</b>
 
svn checkout http://svn.freepascal.org/svn/fpc/trunk/packages/base/imagemagick imagemagick
 
svn checkout http://svn.freepascal.org/svn/fpc/trunk/packages/base/imagemagick imagemagick
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
=== 状态 ===
 
=== 状态 ===
Magick Wand headers are complete and working on both Windows and Linux.
+
PascalMagick 的当前版本可以工作在Windows和Linux上。
  
 
=== 安装 ===
 
=== 安装 ===
  
The current version of PascalMagick works on Windows and Linux. Beta testers are necessary for the Mac OS X version.
+
PascalMagick 的当前版本可以工作在Windows和Linux上,Mac OS X上测试是有必要的。
  
To start with, install ImageMagick binaries from the official website: http://www.imagemagick.org/script/binary-releases.php
+
首先,从官方网站下载并安装ImageMagick:http://www.imagemagick.org/script/binary-releases.php
  
Now download and unzip PascalMagick package (Instructions on the Download section above).
+
现在下载并解压PascalMagick 包(按下载页面说明操作)
  
To check that everything is working, open the PascalMagick/wand/wanddemo.lpi project. Now go to the Project --> "Compiler Options dialog" and change the "Other Units" field to point to "../magick", so it can find the PascalMagick/magick/ImageMagick.pas file. After this you can compile and run the test program.
+
要检查一切正常, 打开 PascalMagick/wand/wanddemo.lpi 项目。Now go to the Project --> "Compiler Options dialog" and change the "Other Units" field to point to "../magick", 因此你可以找到 PascalMagick/magick/ImageMagick.pas 文件,在这之后,你可以编译并运行测试程序。
  
If the program is working, it will load the image.png image located on the same directory as he is, resize it and then save it as a jpg called image.jpg.
+
如果程序正常运行,它会加载目录下的image.png文件,调整大小并转换为image.jpg。
  
One Extra step is necessary on Linux: Rename the image.PNG to image.png due to case issues.
+
一个额外的步骤:在Linux中,你需要重命名image.PNG image.png,由于大小写问题。
  
Under linux you must edit the file PascalMagick/magick/ImageMagick.pas and change <br>
+
Linux下你必须修改 PascalMagick/magick/ImageMagick.pas文件<br>
''<code>WandExport = 'libWand';</code>''   by ''<code>WandExport = 'libMagickWand';</code>''<br>
+
''<code>WandExport = 'libWand';</code>'' ''<code>WandExport = 'libMagickWand';</code>''<br>
but remember PascalMagick is already installed with a recent version of fpc
+
但主记住,PascalMagick 已经安装在最新版本的FPC。
  
 
=== 演示程序1 ===
 
=== 演示程序1 ===
Line 91: Line 91:
 
<syntaxhighlight>
 
<syntaxhighlight>
 
{
 
{
   Demonstration program for the ImageMagick Library
+
   ImageMagick库演示程序
 
+
 
   This program was converted from c by: Felipe Monteiro de Carvalho
+
   这个项目由 Felipe Monteiro de Carvalho 从C转换过来
  
   Usage: Just execute the program. It will resize the image.png image
+
   使用方法:只需要执行程序,它会自动调整目录下的image.png图像,以缩放(106,80),并将其转换为JPG格式。
  on it´s directory to fit (106, 80) and convert it to a jpg.
 
 
    
 
    
 
   Dez/2005
 
   Dez/2005
Line 157: Line 156:
 
=== BUG报告/功能要求 ===
 
=== BUG报告/功能要求 ===
  
Tests are necessary to verify if the bindings work with all versions of ImageMagick.
+
测试是必要的,以难所有版本ImageMagick工作良好。
  
Please post Bug Reports / Feature Requests in the discussion page.
+
请发送问题报告/功能在相应讨论页。
  
 
=== 变更记录 ===
 
=== 变更记录 ===
  
 
*07.11.07
 
*07.11.07
# Added 4 missing functions on magick_image.inc on fpc subversion, but no new release
+
# 添加magick_image.inc上缺少的4个功能到 fpc 版本库
*12.07.06 PascalMagick version 0.4 released
+
*12.07.06 PascalMagick version 0.4 发布
# Last bugs fixed
+
# 最后的bug修复
*24.05.06 PascalMagick version 0.3 released
+
*24.05.06 PascalMagick version 0.3 发布
# Minor fixes on the bindings
+
# 一些小的修正
*10.04.06 PascalMagick version 0.2 released
+
*10.04.06 PascalMagick version 0.2 发布
# Based on ImageMagic 6.2
+
# 基于ImageMagic6.2
# MagickWand API fully translated
+
# MagickWand API完全翻译
# Added a second demonstration program
+
# 添加第二个演示程序
*27.12.05 PascalMagick version 0.1 released
+
*27.12.05 PascalMagick version 0.1 发布
# About 80% of the MagickWand API is translated
+
# 约80%的magickwand API被翻译
# The basic demonstration program is working well
+
# 基本的演示程序运行良好
# Only the very minimum necessary MagickCode headers were translated
+
# 只有MagickCode 标题被翻译
*14.12.05 Began working on a pascal port for the c headers
+
*14.12.05 开始着手pascal端口的c头文件
  
 
=== 帮助 ===
 
=== 帮助 ===
  
Please send help requests to the Lazarus Forum or the Lazarus mailling list.
+
如需帮助请到Lazarus论坛或至电Lazarus列表。
  
 
[[Category:Components]]
 
[[Category:Components]]

Revision as of 12:49, 26 April 2014

English (en) español (es) français (fr) Bahasa Indonesia (id) 日本語 (ja) português (pt) русский (ru) 中文(中国大陆)‎ (zh_CN)

关于

关于 ImageMagick

ImageMagick套件是一款免费的软件,用来开发、创建、编辑和组合位图图像。它支持大量不同格式的图像(超过90种),包括格式如GIF、JPEG、PNG、JPEG2000 、PDF、PhotoCD、TIFF、DPX。图像可以剪裁、颜色改变,可以使用各种效果,图像可以旋转,组合文本、线、多边形、椭圆和贝塞尔曲线,可以添加图片,拉伸或旋转。

该套件运行在所有主流操作系统上,也可在命令行中使用,它的命令行工具也是Linux标准套件之一,在多个发行版中。

特性和功能:

  • 图像格式转换(如JPEG到PNG等等)
  • 改变大小、旋转、锐化、颜色减少,为图像增加特效
  • 创建剪贴画
  • 创建无背景图像
  • 将一组图片变成GIF动画
  • 创建合成图像
  • 画形状或文本在图像上
  • 修饰图像边框或框架
  • 描述图像的格式和特点

ImageMagick 书籍

ImageMagick 技巧 这种快节奏的实用教程中包含了大量照片处理的例子,创建LOGO、动画及完整的WEB项目。有了这本袖珍书,你会在任何时间创建出引人入胜的图像。

关于 MagickWand

MagickWand API 是ImageMagick 团队推荐的接口,它是一个易于使用的编程接口。

关于 MagickCore

该MagickCore API是​​ImageMagick的一个低级别接口。

关于 PascalMagick

This port is a translation of the c header files for both MagickWand and Magick Core. 此端口是C头文件的MagickWand 和Magick 核心翻译。


屏幕截图

作者

Felipe Monteiro de Carvalho

Ángel Eduardo García

许可证

BSD-style and compatible with the GPL.

你可以 阅读授权.

下载

Light bulb  Note: PascalMagick已经包含在所有最近的FPC版本中,你不需要下载它。

旧的版本

PascalMagick 0.4 可以在这里找到: http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=174103&release_id=431432

对于旧版本的FPC,以使用下面的命令下载项目:

<b>地址失效</b>
svn checkout http://svn.freepascal.org/svn/fpc/trunk/packages/base/imagemagick imagemagick

状态

PascalMagick 的当前版本可以工作在Windows和Linux上。

安装

PascalMagick 的当前版本可以工作在Windows和Linux上,Mac OS X上测试是有必要的。

首先,从官方网站下载并安装ImageMagick:http://www.imagemagick.org/script/binary-releases.php

现在下载并解压PascalMagick 包(按下载页面说明操作)

要检查一切正常, 打开 PascalMagick/wand/wanddemo.lpi 项目。Now go to the Project --> "Compiler Options dialog" and change the "Other Units" field to point to "../magick", 因此你可以找到 PascalMagick/magick/ImageMagick.pas 文件,在这之后,你可以编译并运行测试程序。

如果程序正常运行,它会加载目录下的image.png文件,调整大小并转换为image.jpg。

一个额外的步骤:在Linux中,你需要重命名image.PNG 为 image.png,由于大小写问题。

Linux下你必须修改 PascalMagick/magick/ImageMagick.pas文件
WandExport = 'libWand';WandExport = 'libMagickWand';
但主记住,PascalMagick 已经安装在最新版本的FPC。

演示程序1

{
  ImageMagick库演示程序
  
  这个项目由 Felipe Monteiro de Carvalho 从C转换过来

  使用方法:只需要执行程序,它会自动调整目录下的image.png图像,以缩放(106,80),并将其转换为JPG格式。
  
  Dez/2005
}
{Version 0.1}
program wanddemo;

{$mode objfpc}{$H+}

uses 
  SysUtils, magick_wand, ImageMagick;

procedure ThrowWandException(wand: PMagickWand);
var
  description: PChar;
  severity: ExceptionType;
begin
  description := MagickGetException(wand, @severity);
  WriteLn(Format('An error ocurred. Description: %s', [description]));
  description := MagickRelinquishMemory(description);
  Abort;
end;

var
  status: MagickBooleanType;
  wand: PMagickWand;
begin
  { Read an image. }
  
  MagickWandGenesis;

  wand := NewMagickWand;
  
  try
    status := MagickReadImage(wand, 'image.png');
    if (status = MagickFalse) then ThrowWandException(wand);

    { Turn the images into a thumbnail sequence. }

    MagickResetIterator(wand);

    while (MagickNextImage(wand) <> MagickFalse) do
     MagickResizeImage(wand, 106, 80, LanczosFilter, 1.0);

    { Write the image as MIFF and destroy it. }
  
    status := MagickWriteImages(wand, 'image.jpg', MagickTrue);
    if (status = MagickFalse) then ThrowWandException(wand);

  finally
    wand := DestroyMagickWand(wand);

    MagickWandTerminus;
  end;
end.

加载图像到Lazarus中的TBitmap 和 ImageMagick

http://lazarus.freepascal.org/index.php/topic,20016.msg114885.html#msg114885

BUG报告/功能要求

测试是必要的,以难所有版本ImageMagick工作良好。

请发送问题报告/功能在相应讨论页。

变更记录

  • 07.11.07
  1. 添加magick_image.inc上缺少的4个功能到 fpc 版本库
  • 12.07.06 PascalMagick version 0.4 发布
  1. 最后的bug修复
  • 24.05.06 PascalMagick version 0.3 发布
  1. 一些小的修正
  • 10.04.06 PascalMagick version 0.2 发布
  1. 基于ImageMagic6.2
  2. MagickWand API完全翻译
  3. 添加第二个演示程序
  • 27.12.05 PascalMagick version 0.1 发布
  1. 约80%的magickwand API被翻译
  2. 基本的演示程序运行良好
  3. 只有MagickCode 标题被翻译
  • 14.12.05 开始着手pascal端口的c头文件

帮助

如需帮助请到Lazarus论坛或至电Lazarus列表。