2、AspJpeg功能摘要
支持JPEG, GIF, BMP, TIFF 和 PNG 格式图片. 输出格式始终为 JPEG
源图片可以来源于磁盘、内存、或者记录集(数据库)
缩略图片可以保存到磁盘、内存、或者HTTP流
支持三种更改大小方式: nearest-neighbor, bilinear, and bicubic.
可以在图片之上添加图片或者文字.
支持画中画
支持复制,反转,旋转,锐化,灰度调节.
可以调节压缩比率,以得到最佳输出效果和大小.
从Jpeg图片中抽取EXIF 和 IPTC数据.
CMYK-RGB转换
Read/write access to individual pixels of an image. (从图象中对任意象素进行读/写存取。)
3、AspJpeg系统需求
Windows 95/98/NT/2000/XP/2003, and
IIS 4.0+ and ASP/ASP.NET, or
Visual Basic 5.0+, or
Visual C++ 5.0+, or
any development environment supporting COM.
9、如何用AspJpeg组件进行图片合并?
AspJpeg 1.3+ enables you to place images on top of each other via the method DrawImage. To use this method, you must create two instances of the AspJpeg objects and populate both of them with images via calls to Open (or OpenBinary). When calling Canvas.DrawImage, the 2nd instance of AspJpeg is passed as an argument to this method, along with the X and Y offsets (in pixels):
使用该方法,您必需创建两个AspJpeg实例对象
10、如何用AspJpeg组件进行图片切割?
AspJpeg 1.1+ is also capable of cutting off edges from, or cropping, the resultant thumbnails via the method Crop(x0, y0, x1, y1). The size of the cropped image is specified by the coordinates of the upper-left and lower-right corners within the resultant thumbnail, not the original large image.
12、如何让AspJpeg组件支援数据库?
图片存进数据库只能以二进制数据保存,这里即利用AspJpeg的Binary方法,下面以两个AspJpeg用户手册上的代码为例,具体请参考AspJpeg用户手册:
Opening Images from Memory
<%' Using ADO, open database with an image blob
strConnect = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("../db/AspJpeg.mdb")
Set rs = Server.CreateObject("adodb.recordset")
SQL = "select image_blob from images2 where id = " & Request("id")
rs.Open SQL, strConnect, 1, 3
Set Jpeg = Server.CreateObject("Persits.Jpeg")
' Open image directly from recordset
Jpeg.OpenBinary rs("image_blob").Value
' Resize
jpeg.Width = Request("Width")
' Set new height, preserve original aspect ratio
jpeg.Height = jpeg.OriginalHeight * jpeg.Width / jpeg.OriginalWidth
Jpeg.SendBinary
rs.Close
%>
Sub jpegclass(J_imgurl, J_fontsize, J_family, J_isbold, J_top, J_Left, J_Content) '调用过程名
If Len(J_imgurl) = 0 Or Len(J_Content) = 0 Then Exit Sub
Dim JPEG, font_color, font_size, font_family, f_width, f_height, f_Content
Set JPEG = Server.CreateObject("Persits.JPEG")
JPEG.Open Server.MapPath(J_imgurl)
font_size = 10
font_family = "宋体"
f_Left = 5
f_top = 5
If J_fontsize<>"" Then font_size = J_fontsize '字体大小
If J_family<>"" Then font_family = J_family '字体
If J_top<>"" Then f_Left = J_Left '水印离图片左边位置
If J_Left<>"" Then f_top = J_top '水印离图片J_top位置
f_Content = J_Content
' 添加文字水印
JPEG.Canvas.Font.Color = &hff0000 ' 红色
JPEG.Canvas.Font.family = font_family
JPEG.canvas.font.Size = font_size
If J_isbold = 1 Then
JPEG.Canvas.Font.Bold = True
End If
JPEG.Canvas.Print f_Left, f_top, f_Content
JPEG.Save Server.MapPath(J_imgurl)
Set JPEG = Nothing
End Sub
%>