2、AspJpeg功能摘要 支持JPEG, GIF, BMP, TIFF 和 PNG 格式圖片. 輸出格式始終為 JPEG 源圖片可以來源于磁盤、內存、或者記錄集(數(shù)據(jù)庫) 縮略圖片可以保存到磁盤、內存、或者HTTP流 支持三種更改大小方式: nearest-neighbor, bilinear, and bicubic. 可以在圖片之上添加圖片或者文字. 支持畫中畫 支持復制,反轉,旋轉,銳化,灰度調節(jié). 可以調節(jié)壓縮比率,以得到最佳輸出效果和大小. 從Jpeg圖片中抽取EXIF 和 IPTC數(shù)據(jù). CMYK-RGB轉換 Read/write access to individual pixels of an image. (從圖象中對任意象素進行讀/寫存取。)
3、AspJpeg系統(tǒng)需求 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): 使用該方法,您必需創(chuàng)建兩個AspJpeg實例對象 % Set Jpeg1 = Server.CreateObject("Persits.Jpeg") Set Jpeg2 = Server.CreateObject("Persits.Jpeg") Jpeg1.Open Server.MapPath("t.jpg") Jpeg2.Open Server.MapPath("t1.jpg") Jpeg1.Canvas.DrawImage 10, 10, Jpeg2 ' optional arguments omitted jpeg1.save Server.mappath("tt.jpg") %>
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. % Set Jpeg = Server.CreateObject("Persits.Jpeg") Jpeg.Open Server.MapPath("t.jpg") jpeg.Crop 20, 30, jpeg.Width - 20, jpeg.Height - 10 jpeg.save Server.mappath("tt.jpg") Response.write("img src=tt.jpg>") %>
11、如何用AspJpeg組件創(chuàng)建安全碼? 創(chuàng)建安全碼原理上和創(chuàng)建水印差不多。 % function make_randomize(max_len,w_n) 'max_len 生成長度,w_n:0 可能包含字母,1:只為數(shù)字 randomize for intcounter=1 to max_len whatnext=int((1-0+1)*rnd+w_n) if whatnext=0 then upper=122 lower=97 else upper=57 lower=48 end if strnewpass=strnewpass chr(int((upper-lower+1)*rnd)+lower) next make_randomize=strnewpass end function
12、如何讓AspJpeg組件支援數(shù)據(jù)庫? 圖片存進數(shù)據(jù)庫只能以二進制數(shù)據(jù)保存,這里即利用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 %>