Asp组件高级入门与精通系列之一
2008-02-23 09:37:16来源:互联网 阅读 ()
很久没有写这个系列了,最近一直在忙其他的东西
高级的组件话题我们将讨论一些比较难实现的,复杂的东西
前段时间我写了一个龙卷风缩略图水印组件,感觉效果还不错,由于是vb写的,有一些难度,大家一起来看看
这里有帖子:http://community.csdn.net/Expert/topic/4115/4115767.xml?temp=.9513056
功能如下:
龙卷风缩略图水印组件1.0版
功能特点:
1.支持从bmp位图,jpeg,gif导入
2.仅支持生成jpeg格式
3.文字水印,支持自定义字体,旋转角度,颜色,字体宽度和高度
4.图片水印,支持透明度
5.暂时不支持直接将文件流写入浏览器
6.消耗系统资源少
7.每个例子都有详细的注释
龙卷风缩略图水印组件0.9版
功能特点:
1.仅仅支持从bmp位图导入
2.仅仅支持生成jpeg格式
3.消耗系统资源少
版本历史
龙卷风缩略图水印组件1.0版
时间:2005-02-13
增加了对jpg,gif图像导入的支持
时间:2005-02-12
功能:增加了图片水印功能
时间:2005-02-11
功能:增加了文字水印功能
龙卷风缩略图水印组件0.9版
时间:2005-02-10
功能:仅支持bmp位图导入功能,支持生成jpeg功能,只有缩略功能
可以免费使用,无任何限制
如有问题,希望提出,以便我改进
我的email:yyg19780718@163.com
代码如下:
模块1:
Option Explicit
'有部分代码不需要,以后可能会用到
Public Const LR_LOADFROMFILE = &H10
Public Const IMAGE_BITMAP = 0
Public Const IMAGE_ICON = 1
Public Const IMAGE_CURSOR = 2
Public Const IMAGE_ENHMETAFILE = 3
Public Const SRCCOPY As Long = &HCC0020
Public Const BI_RGB = 0&
Public Const DIB_RGB_COLORS = 0 '结构BITMAPINFO中包含了RGB值的数组RGBQUAD
Public Const STRETCH_HALFTONE As Long = &H4&
Public Type BITMAPINFOHEADER '40 字节位图文件头
biSize As Long '结构所需字节数
biWidth As Long '图像宽度
biHeight As Long '图像高度
biPlanes As Integer '必须为1,不用考虑
biBitCount As Integer '颜色位数
biCompression As Long '指定是否压缩,一般取BI_RGB
biSizeImage As Long '实际的位图占据的字节数,=biWidth'(必须是4的整数〕*biHeight
biXPelsPerMeter As Long '水平分辨率
biYPelsPerMeter As Long '垂直分辨率
biClrUsed As Long '本图像用到的实际实际颜色数
biClrImportant As Long '本图像中重要的颜色数,为0,则认为所有的图像都是重要的
End Type
Public Type RGBQUAD
rgbBlue As Byte '该颜色的蓝色分量
rgbGreen As Byte '该颜色的绿色分量
rgbRed As Byte '该颜色的红色分量
rgbReserved As Byte '保留值
End Type
Public Type Bitmap
bmType As Long
bmWidth As Long
bmHeight As Long
bmWidthBytes As Long
bmPlanes As Integer
bmBitsPixel As Integer
bmBits As Long
End Type
Public Type BitmapInfo
bmiHeader As BITMAPINFOHEADER
bmiColors As RGBQUAD
End Type
Public Type BITMAPFILEHEADER
bfType(1 To 2) As Byte
bfSize As Long
bfReserved1 As Integer
bfReserved2 As Integer
bfOffBits As Long
End Type
Public Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Public Declare Function CreateDIBSection Lib "gdi32" (ByVal hdc As Long, pBitmapInfo As BitmapInfo, ByVal un As Long, ByVal lplpVoid As Long, ByVal handle As Long, ByVal dw As Long) As Long
Public Declare Function GetDIBits Lib "gdi32" (ByVal aHDC As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, lpBits As Any, lpBI As BitmapInfo, ByVal wUsage As Long) As Long
Public Declare Function SetDIBitsToDevice Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal dx As Long, ByVal dy As Long, ByVal SrcX As Long, ByVal SrcY As Long, ByVal Scan As Long, ByVal NumScans As Long, Bits As Any, BitsInfo As BitmapInfo, ByVal wUsage As Long) As Long
Public Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Public Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
Public Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Public Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Public Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Public Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
Public Declare Function LoadImage Lib "user32" Alias "LoadImageA" (ByVal hInst As Long, ByVal lpsz As String, ByVal dwImageType As Long, ByVal dwDesiredWidth As Long, ByVal dwDesiredHeight As Long, ByVal dwFlags As Long) As Long
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
下一篇:Asp组件高级入门与精通系列之二
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash