码迷,mamicode.com
首页 > 其他好文 > 详细

luagd介绍

时间:2016-04-05 00:12:26      阅读:204      评论:0      收藏:0      [点我收藏+]

标签:

luagd

官网:

http://ittner.github.io/lua-gd/

 

下载

http://files.luaforge.net/releases/lua-gd/lua-gd/lua-gd-2.0.33r2forLua5.1

 

Lua-GD is a set of Lua bindings to the Thomas Boutell‘s gd library that allows your code to quickly draw complete images with lines, polygons, arcs, text, multiple colors, cut and paste from other images, flood fills, read in or write out images in the PNG, JPEG or GIF format. It is not a kitchen-sink graphics package, but it does include most frequently requested features, including both truecolor and palette images, resampling (smooth resizing of truecolor images) and so forth. It is particularly useful in Web applications.

Lua-GD is a programming library, not a paint program. If you are looking for that or are not familiar to the Lua Programming Language, you are in the wrong place.

The Lua-GD API is not identical to the gd C API: it was changed in a way that make it more familiar to Lua users and use the extra power provided by Lua, at cost of some learning for those that already use gd. Documentation on API are available on the download package and as an online manual.

=====》

LUA GD 是一种对gd库的lua语言绑定, gd库允许你快速画线条、多边形、弧形、文字、多种颜色。支持的图片格式为 PNG JPEG GIF。

LUA GD是一种编程库,不是绘画程序。 如果你想找绘画程序, 或者 不熟悉lua编程语言, 你来错了地方。

LUA GD接口并不完全等同于GD接口。

gd库(GD Graphics (Draw) Library)

https://github.com/libgd/libgd

GD is an open source code library for the dynamic creation of images by programmers.

GD is written in C, and "wrappers" are available for Perl, PHP and other languages. GD can read and write many different image formats. GD is commonly used to generate charts, graphics, thumbnails, and most anything else, on the fly.

The most common applications of GD involve website development, although it can be used with any standalone application!

=========》

GD是一个开源的代码库, 程序员可以使用它, 动态创建图片。

GD使用C实现, 有一层包裹语言, 例如 PHP

用于创建图表、图片、标志。

GD往往被网站开发使用, 但是它也可以用在任何独立的应用上。

 

应用

网站登录验证码:

http://www.cnblogs.com/chutianyao/archive/2010/07/21/1782008.html

这样总共用不到20行代码就实现了一个简单的验证码,效果如下:

技术分享

虽然基本实现了验证码图片的生成,但还不太理想;要实现真正可用的验证码,大概还需要做如下处理:设置不同字体、字符要随机倾斜、要随机模糊字符、要增加干扰等。

luagd介绍

标签:

原文地址:http://www.cnblogs.com/lightsong/p/5353187.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!