aspjpeg缩小图片的组件使用介绍(2)

aspjpeg

Adjusting Image Compression (advanced users only)

The JPEG format uses "lossy" compression methods. This means that some minor details of an image saved as a JPEG are lost during compression. The degree of loss can be adjusted via the jpeg.Quality property. This property accepts an integer in the range 0 to 100, with 0 being the highest degree of loss (and hence, the lowest quality) and 100 being the lowest degree of loss and highest quality.
The lower the loss, the larger the resultant file size. The property jpeg.Quality is set to 80 by default which provides a close-to-optimal combination of quality and file size. Changing this property is generally not recommended.

AspJpeg Object Reference

AspJpeg Properties
Expires As Date (read-only)
Returns the component's expiration date. If a valid registration key is installed, returns 9/9/9999.
Height As Long (read/write)
Specifies a new image height (in pixels). Must be called after an image is opened via the Open method.
Interpolation As Long (read/write)
Specifies an image resizing algorithm. The following values are currently supported: 0 (Nearest-Neighbor), 1 (Bilinear, default) and 2 (Bicubic).
The Nearest-Neighbor (NN) is the fastest but provides low-quality thumbnails.

The Bilinear method offers much better thumbnail quality but is approximately 2 times as slow as NN.

The Bicubic method is approximately twice as slow as Bilinear and 4 times as slow as NN, but supposedly offers the highest quality. In many cases, however, it provides little, if any, noticeable improvement over the Bilinear method.

Default: 1 (Bilinear).

OriginalHeight As Long (read-only)
Returns the original image height (in pixels). Can only be called after an image is opened via the Open method. Use this property to preserve the original aspect ratio of an image.
OriginalWidth As Long (read-only)
Returns the original image width (in pixels).Can only be called after an image is opened via the Open method. Use this property to preserve the original aspect ratio of an image.
Quality As Long (read/write)
Specifies the degree of compression loss. Affects the resultant image quality and file size.
Accepts an integer value in the range 0 to 100, 0 being the lowest quality, highest loss and smallest file size. The higher the value the higher the image quality, and the larger the file size.

The property Quality is set to 80 by default which offers a close-to-optimal combination of image quality and file size. Changing this property is generally not recommended.

Width As Long (read/write)
Specifies a new image width (in pixels). Must be called after an image is opened via the Open method.
AspJpeg Methods
Sub Close()
Closes a file opened via the Open method. This method is called automatically upon the destruction of the AspJpeg object, so you do not have to call it explicitly, unless there is an immediate need to free the file handle (such as, if you need to delete the file).
Sub Crop(x0 As Long, y0 As Long, x1 As Long, y1 As Long)
Cuts edges off of a thumbnail. For this method to take effect, you must call it before calling .Save or .SendBinary.
The arguments (x0, y0) and (x1, y1) are the coordinates of the upper-left and lower-right corners of the desired cropped image within the thumbnail. For example, if the original large image is 300 pixels wide and 200 pixels high, the following sequence will produce a cropped thumbnail which is 60 pixels wide and 40 pixels high:

Jpeg.Width = 120
Jpeg.Height = 80
' Crop 20 pixels from left, 30 from top.
' Make image size 60 by 40.
Jpeg.Crop 20, 30, 80, 70

Sub FlipH()
Flips the resultant thumbnail horizontally. For this method to take effect, you must call it before calling .Save or .SendBinary.
Sub FlipV()
Flips the resultant thumbnail vertically. For this method to take effect, you must call it before calling .Save or .SendBinary.
Sub Open(Path As String)
Opens a JPEG image for resizing. Path must be a physical path to the image.
Sub Save(Path As String)
Resizes the currently opened image using parameters specified by various properties. Save the resultant image thumbnail to a file specified by Path. If a file with this name already exists it will be overwritten.
Sub SendBinary(Optional ContentDisposition)
Resizes the currently opened image using parameters specified by various properties. Sends the resultant image directly to the client browser by internally calling Response.BinaryWrite. Automatically sets the Content-Type header to "image/jpeg".
If ContentDisposit

时间: 2024-10-30 08:08:18

aspjpeg缩小图片的组件使用介绍(2)的相关文章

aspjpeg缩小图片的组件使用介绍(1)

aspjpeg AspJpeg 1.1 Programmer's Manual Copyright (c) 2000 Persits Software, Inc.All Rights Reserved. This software is based in part on the work of the Independent JPEG Group (IJG) What is AspJpeg? AspJpeg is an active server component that creates r

PS缩小图片不失真方法图解

  我们在搜图的过程中,好不容易找到个合适的.但由于图片大小不对,我们不得不借助于工具去处理,若处理不好图片就变形了.使用Photoshop处理将图片文件大小缩小,有时候也需要将图片的大小缩小.Photoshop可以很轻松的完成.下面的步骤比较简单但很实用. 方法/步骤 打开Photoshop,可以可以打开文件找到图片,也可以直接将图片拖拉到Photoshop中 方式一:缩小图像的像素 在菜单栏中选择图像-->图像大小,设置宽度和高度的像素 最好选择约束比例,同比例的缩小 方式二:存储为web和

JS图片浏览组件PhotoLook的公开属性方法介绍和进阶实例代码_图象特效

属性 speed :设置图片切换的速度 width:组件的宽度 height:组件的高度 cellStructures:可设置效果矩阵的行列例如{row:8,col:8}注意,这个行列要和效果矩阵switchTable的行列对应 方法 init():初始化 addswitchTable(switchTable):添加效果矩阵 add(url):添加图片 addswitchMethod(func,type):添加切换方法(例如淡出,滑出),现在功能未完整,type只能填"show"一个值

图片自动保存到本地并利用aspjpeg为图片加水印

aspjpeg <%'函数功能:远程图片自动保存到本地服务器,并利用aspjpeg为图片加上水印'(注意:请先在目录下创建images目录,用来保存临时图片)'本程序需要在服务器上安装"aspjpeg组件"否则无法正常使用'也可以只取'''''22222222'''''''以上的部分,这部分可以保存图片,第二部分是进行水印增加'使用方法,请保存为saveimg.asp'saveimg.asp?url=logo.gif 即可以取下图片啦,HOHO. 其他需要加的功能,大家自己扩展好

Android实现手势滑动多点触摸放大缩小图片效果_Android

网上文章虽多,但是这种效果少之又少,我真诚的献上以供大家参考 实现原理:自定义ImageView对此控件进行相应的layout(动态布局). 这里你要明白几个方法执行的流程: 首先ImageView是继承自View的子类.onLayout方法:是一个回调方法.该方法会在在View中的layout方法中执行,在执行layout方法前面会首先执行setFrame方法.setFrame方法:判断我们的View是否发生变化,如果发生变化,那么将最新的l,t,r,b传递给View,然后刷新进行动态更新UI

Android实现旋转,放大,缩小图片的方法_Android

本文实例讲述了Android实现旋转,放大,缩小图片的方法.分享给大家供大家参考,具体如下: 项目中需要做到一个预览图片的功能 最初设想自定义个一个view,在onDraw中用的是生成新的Bitmap,来放大,缩小 但由于手机内存是有限制的,在放大几倍以后,就会core掉. 后面直接选用imageview来完成此项任务,很遗憾,虽然不会重复生成bitmap导致core掉,但是imageview的大小限制是图片无法再放大或放大也只能在这个区域中. 最后选定用 当然  Drawable来做了 pri

图片自动保存到本地并利用aspjpeg为图片加水印_小偷/采集

<% '函数功能:远程图片自动保存到本地服务器,并利用aspjpeg为图片加上水印 '(注意:请先在目录下创建images目录,用来保存临时图片) '本程序需要在服务器上安装"aspjpeg组件"否则无法正常使用 '也可以只取'''''22222222'''''''以上的部分,这部分可以保存图片,第二部分是进行水印增加 '使用方法,请保存为saveimg.asp 'saveimg.asp?url=yun_qi_img/logo.gif 即可以取下图片啦,HOHO. 其他需要加的功

JS等比例缩小图片尺寸

为了提升用户体验,网站用户在上传图片的时候,我们不能够让用户自己去处理图片以达到我们的要求. 而通常像淘宝上商品实物展示这样的页面,我们需要控制的主要是图片的宽度. 又考虑到html页面解析顺序可能导致的一些问题,决定通过定义一个简单的功能函数,然后在img元素中添加onload事件来调用的方式进行实现,代码如下: JS部分 <script type="text/javascript"> function changeImg(objImg) { var most = 690

如何使用画图软件快速缩小图片大小

  我们经常把一些用手机拍的家人或是朋友的照片保存在电脑里,但是文件像素很高,所以照片很大,分辨率高的甚至都达到10M,浪费了硬盘空间.那么如何快速缩小图片大小呢 首先我们右击图片--选择属性--查看文件此时的大小. 首先选中图片鼠标右击--选择打开方式--画图--如下图: 在菜单找到图像--选择拉伸/扭曲--如下图: 在水平和垂直栏中数值都设置为40%--点击确定就可以.了 我们再次右击图片--选择属性--查看文件修改后的大小--而此时文件只有176KB了,这个办法还不错吧!自己也动手试试吧!