PascalMagick/zh CN: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: PascalMagick/zh CN
| Old | New | Line | |
|---|---|---|---|
| 1 | + | ### 关于 | |
| 2 | + | ||
| 3 | + | #### 关于 ImageMagick | |
| 4 | + | ||
| 5 | + | [ImageMagick](http://www.imagemagick.org)套件是一款免费的软件,用来开发、创建、编辑和组合位图图像。它支持大量不同格式的图像(超过90种),包括格式如GIF、JPEG、PNG、JPEG2000 、PDF、PhotoCD、TIFF、DPX。图像可以剪裁、颜色改变,可以使用各种效果,图像可以旋转,组合文本、线、多边形、椭圆和贝塞尔曲线,可以添加图片,拉伸或旋转。 | |
| 6 | + | ||
| 7 | + | 查看[维基百科上的ImageMagick](https://zh.wikipedia.org/zh-cn/ImageMagick)。 | |
| 8 | + | ||
| 9 | + | 该套件运行在所有主流操作系统上,也可在命令行中使用,它的命令行工具也是Linux标准套件之一,在多个发行版中。 | |
| 10 | + | ||
| 11 | + | 特性和功能: | |
| 12 | + | ||
| 13 | + | - 图像格式转换(如JPEG到PNG等等) | |
| 14 | + | - 改变大小、旋转、锐化、颜色减少,为图像增加特效 | |
| 15 | + | - 创建剪贴画 | |
| 16 | + | - 创建无背景图像 | |
| 17 | + | - 将一组图片变成GIF动画 | |
| 18 | + | - 创建合成图像 | |
| 19 | + | - 画形状或文本在图像上 | |
| 20 | + | - 修饰图像边框或框架 | |
| 21 | + | - 描述图像的格式和特点 | |
| 22 | + | ||
| 23 | + | #### ImageMagick 书籍 | |
| 24 | + | ||
| 25 | + | [ImageMagick 技巧](http://www.packtpub.com/imagemagick/book) 这种快节奏的实用教程中包含了大量照片处理的例子,创建LOGO、动画及完整的WEB项目。有了这本袖珍书,你会在任何时间创建出引人入胜的图像。 | |
| 26 | + | ||
| 27 | + | #### 关于 MagickWand | |
| 28 | + | ||
| 29 | + | [MagickWand API](http://www.imagemagick.org/script/magick-wand.php) 是ImageMagick 团队推荐的接口,它是一个易于使用的编程接口。 | |
| 30 | + | ||
| 31 | + | #### 关于 MagickCore | |
| 32 | + | ||
| 33 | + | 该MagickCore API是ImageMagick的一个低级别接口。 | |
| 34 | + | ||
| 35 | + | #### 关于 PascalMagick | |
| 36 | + | ||
| 37 | + | This port is a translation of the c header files for both MagickWand and Magick Core. ~~此端口是C头文件的MagickWand 和Magick 核心翻译。~~ | |
| 38 | + | ||
| 39 | + | ### 屏幕截图 | |
| 40 | + | ||
| 41 | + | ### 作者 | |
| 42 | + | ||
| 43 | + | Felipe Monteiro de Carvalho | |
| 44 | + | ||
| 45 | + | Ángel Eduardo García | |
| 46 | + | ||
| 47 | + | ### 许可证 | |
| 48 | + | ||
| 49 | + | BSD-style and compatible with the GPL. | |
| 50 | + | ||
| 51 | + | 你可以 [阅读授权](http://www.imagemagick.org/script/license.php). | |
| 52 | + | ||
| 53 | + | ### 下载 | |
| 54 | + | ||
| 55 | + | > **Note:** PascalMagick已经包含在所有最近的FPC版本中,你不需要下载它。 | |
| 56 | + | ||
| 57 | + | #### 旧的版本 | |
| 58 | + | ||
| 59 | + | PascalMagick 0.4 可以在这里找到: <http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=174103&release_id=431432> | |
| 60 | + | ||
| 61 | + | 对于旧版本的FPC,以使用下面的命令下载项目: | |
| 62 | + | ||
| 63 | + | ``` bash | |
| 64 | + | <b>地址失效</b> | |
| 65 | + | svn checkout http://svn.freepascal.org/svn/fpc/trunk/packages/base/imagemagick imagemagick | |
| 66 | + | ``` | |
| 67 | + | ||
| 68 | + | ### 状态 | |
| 69 | + | ||
| 70 | + | PascalMagick 的当前版本可以工作在Windows和Linux上。 | |
| 71 | + | ||
| 72 | + | ### 安装 | |
| 73 | + | ||
| 74 | + | PascalMagick 的当前版本可以工作在Windows和Linux上,Mac OS X上测试是有必要的。 | |
| 75 | + | ||
| 76 | + | 首先,从官方网站下载并安装ImageMagick:http://www.imagemagick.org/script/binary-releases.php | |
| 77 | + | ||
| 78 | + | 现在下载并解压PascalMagick 包(按下载页面说明操作) | |
| 79 | + | ||
| 80 | + | 要检查一切正常, 打开 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 文件,在这之后,你可以编译并运行测试程序。 | |
| 81 | + | ||
| 82 | + | 如果程序正常运行,它会加载目录下的image.png文件,调整大小并转换为image.jpg。 | |
| 83 | + | ||
| 84 | + | 一个额外的步骤:在Linux中,你需要重命名image.PNG 为 image.png,由于大小写问题。 | |
| 85 | + | ||
| 86 | + | Linux下你必须修改 PascalMagick/magick/ImageMagick.pas文件\ | |
| 87 | + | *`WandExport = 'libWand';`* 为 *`WandExport = 'libMagickWand';`*\ | |
| 88 | + | 但主记住,PascalMagick 已经安装在最新版本的FPC。 | |
| 89 | + | ||
| 90 | + | ### 演示程序1 | |
| 91 | + | ||
| 92 | + | ``` pascal | |
| 93 | + | { | |
| 94 | + | ImageMagick库演示程序 | |
| 95 | + | ||
| 96 | + | 这个项目由 Felipe Monteiro de Carvalho 从C转换过来 | |
| 97 | + | ||
| 98 | + | 使用方法:只需要执行程序,它会自动调整目录下的image.png图像,以缩放(106,80),并将其转换为JPG格式。 | |
| 99 | + | ||
| 100 | + | Dez/2005 | |
| 101 | + | } | |
| 102 | + | {Version 0.1} | |
| 103 | + | program wanddemo; | |
| 104 | + | ||
| 105 | + | {$mode objfpc}{$H+} | |
| 106 | + | ||
| 107 | + | uses | |
| 108 | + | SysUtils, magick_wand, ImageMagick; | |
| 109 | + | ||
| 110 | + | procedure ThrowWandException(wand: PMagickWand); | |
| 111 | + | var | |
| 112 | + | description: PChar; | |
| 113 | + | severity: ExceptionType; | |
| 114 | + | begin | |
| 115 | + | description := MagickGetException(wand, @severity); | |
| 116 | + | WriteLn(Format('An error ocurred. Description: %s', [description])); | |
| 117 | + | description := MagickRelinquishMemory(description); | |
| 118 | + | Abort; | |
| 119 | + | end; | |
| 120 | + | ||
| 121 | + | var | |
| 122 | + | status: MagickBooleanType; | |
| 123 | + | wand: PMagickWand; | |
| 124 | + | begin | |
| 125 | + | { Read an image. } | |
| 126 | + | ||
| 127 | + | MagickWandGenesis; | |
| 128 | + | ||
| 129 | + | wand := NewMagickWand; | |
| 130 | + | ||
| 131 | + | try | |
| 132 | + | status := MagickReadImage(wand, 'image.png'); | |
| 133 | + | if (status = MagickFalse) then ThrowWandException(wand); | |
| 134 | + | ||
| 135 | + | { Turn the images into a thumbnail sequence. } | |
| 136 | + | ||
| 137 | + | MagickResetIterator(wand); | |
| 138 | + | ||
| 139 | + | while (MagickNextImage(wand) <> MagickFalse) do | |
| 140 | + | MagickResizeImage(wand, 106, 80, LanczosFilter, 1.0); | |
| 141 | + | ||
| 142 | + | { Write the image as MIFF and destroy it. } | |
| 143 | + | ||
| 144 | + | status := MagickWriteImages(wand, 'image.jpg', MagickTrue); | |
| 145 | + | if (status = MagickFalse) then ThrowWandException(wand); | |
| 146 | + | ||
| 147 | + | finally | |
| 148 | + | wand := DestroyMagickWand(wand); | |
| 149 | + | ||
| 150 | + | MagickWandTerminus; | |
| 151 | + | end; | |
| 152 | + | end. | |
| 153 | + | ``` | |
| 154 | + | ||
| 155 | + | ### 加载图像到Lazarus中的TBitmap 和 ImageMagick | |
| 156 | + | ||
| 157 | + | <http://lazarus.freepascal.org/index.php/topic,20016.msg114885.html#msg114885> | |
| 158 | + | ||
| 159 | + | ### BUG报告/功能要求 | |
| 160 | + | ||
| 161 | + | 测试是必要的,以难所有版本ImageMagick工作良好。 | |
| 162 | + | ||
| 163 | + | 请发送问题报告/功能在相应讨论页。 | |
| 164 | + | ||
| 165 | + | ### 变更记录 | |
| 166 | + | ||
| 167 | + | - 07.11.07 | |
| 168 | + | ||
| 169 | + | 1. 添加magick_image.inc上缺少的4个功能到 fpc 版本库 | |
| 170 | + | ||
| 171 | + | - 12.07.06 PascalMagick version 0.4 发布 | |
| 172 | + | ||
| 173 | + | 1. 最后的bug修复 | |
| 174 | + | ||
| 175 | + | - 24.05.06 PascalMagick version 0.3 发布 | |
| 176 | + | ||
| 177 | + | 1. 一些小的修正 | |
| 178 | + | ||
| 179 | + | - 10.04.06 PascalMagick version 0.2 发布 | |
| 180 | + | ||
| 181 | + | 1. 基于ImageMagic6.2 | |
| 182 | + | 2. MagickWand API完全翻译 | |
| 183 | + | 3. 添加第二个演示程序 | |
| 184 | + | ||
| 185 | + | - 27.12.05 PascalMagick version 0.1 发布 | |
| 186 | + | ||
| 187 | + | 1. 约80%的magickwand API被翻译 | |
| 188 | + | 2. 基本的演示程序运行良好 | |
| 189 | + | 3. 只有MagickCode 标题被翻译 | |
| 190 | + | ||
| 191 | + | - 14.12.05 开始着手pascal端口的c头文件 | |
| 192 | + | ||
| 193 | + | ### 帮助 | |
| 194 | + | ||
| 195 | + | 如需帮助请到Lazarus论坛或至电Lazarus列表。 | |
| 196 | + | ||
| 197 | + | --- | |
| 198 | + | *From the Free Pascal wiki, page "PascalMagick/zh CN", as it stood on 2020-02-23 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
