ASP components advanced introductory and Proficient series one

Source: Internet
Author: User
Tags integer
Senior

Haven't written this series in a long time, and have been busy with other things lately

Advanced Component Topics We'll discuss some of the more difficult and complex things

Some time ago I wrote a tornado thumbnail watermark component, the feeling is good, because it is written in VB, there are some difficulties, we look at

Here are the posts: http://community.csdn.net/Expert/topic/4115/4115767.xml?temp=.9513056

Features are as follows:

Tornado thumbnail Watermark Component version 1.0
function characteristic:
1. Support from BMP bitmap, jpeg,gif import
2. Only support the generation of JPEG format
3. Text watermark, support custom font, rotation angle, color, font width and height
4. Image watermark, support transparency
5. Do not support direct file flow to the browser temporarily
6. Less resources to consume the system
7. Each example has a detailed annotation


Tornado thumbnail Watermark Component version 0.9
function characteristic:
1. Only support from BMP bitmap Import
2. Only support the generation of JPEG format
3. Less resources to consume the system

Version history
Tornado thumbnail Watermark Component version 1.0
Time: 2005-02-13
Increased support for Jpg,gif image import
Time: 2005-02-12
Function: Increase the image watermark function
Time: 2005-02-11
Function: Added the function of text watermark

Tornado thumbnail Watermark Component version 0.9
Time: 2005-02-10
Function: Only BMP bitmap Import function, support to generate JPEG function, only abbreviated function


Free to use without any restrictions
If there is a problem, wish to raise it so that I can improve
My email:yyg19780718@163.com.

The code is as follows:

Module 1:

Option Explicit
' Some of the code is not needed and may be used later

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&
The public Const dib_rgb_colors = 0 ' structure bitmapinfo contains an array of RGB values Rgbquad
Public Const stretch_halftone as Long = &H4&

Public Type bitmapinfoheader ' 40 byte bitmap file header
Number of bytes required for bisize as Long ' structure
Biwidth as Long ' image width
Biheight as Long ' image height
biplanes as Integer ' must be 1 without consideration
biBitCount as Integer ' color digits
Bicompression as Long ' Specifies whether to compress, generally fetch BI_RGB
biSizeImage as Long ' the actual bitmap occupies the number of bytes, =biwidth ' (Must be an integer of 4)*biheight
Bixpelspermeter as Long ' horizontal resolution
Biypelspermeter as Long ' vertical resolution
biClrUsed as Long ' the actual number of actual colors used in this image
Biclrimportant as Long ' the important number of colors in this image is 0, it is considered that all images are important
End Type

Public Type Rgbquad
Rgbblue as Byte blue component of the color
Rgbgreen as Byte green component of the color
Rgbred as Byte the red component of the color
Rgbreserved as Byte ' preserve value
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, Byva L 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 Lo Ng, ByVal dy as Long, ByVal SRCX as Long, ByVal Srcy as Long, ByVal Scan as Long, ByVal Numscans as Long, Bits as any, Bit Sinfo 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 Bi



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.