AspJpeg component picture plus text picture watermark online picture cut zoom enlarge picture (1/3)

Source: Internet
Author: User
Tags transparent color
Class Lyout_image
Dim Objjpeg ' AspJpeg Object
Dim objFSO ' File Read-write Object
Dim Intimagewidth ' Image Width
Dim intimageheight ' Image Height
Dim strmessage ' as operational information
Dim flagopen ' File Open flag
Dim intjpegwidth ' Watermark Area width
Dim intjpegheight ' Watermark Area height
Dim intjpegcolor ' Watermark Text color or watermark picture transparent color
Dim strjpegfamily ' Watermark Text font
Dim Flagjpegbold ' Watermark Text is bold
Dim intjpegsize ' Watermark Text size
Dim floatjpegopacity ' Watermark Picture transparency

Public Property Get Width ()
width = intimagewidth
End Property

Public Property Get Height ()
Height = intimageheight
End Property

Public Property Let Message (ByVal strmsg)
strmessage = strmsg
End Property

Public Property Get Message ()
message = strmessage
End Property

Public Property Get Fileisopen ()
Fileisopen = Flagopen
End Property

Public Property Let Jpegwidth (ByVal intwidth)
Intjpegwidth = intwidth
End Property

Public Property Let Jpegheight (ByVal intheight)
Intjpegheight = intheight
End Property

Public Property Let Jpegcolor (ByVal intcolor)
Intjpegcolor = Intcolor
End Property

Public Property Let Jpegfamily (ByVal strfamily)
strjpegfamily = strfamily
End Property

Public Property Let Jpegbold (ByVal flagbold)
Flagjpegbold = CBool (flagbold)
End Property

Public Property Let Jpegsize (ByVal intsize)
Intjpegsize = intsize
End Property

Public Property Let Jpegopacity (ByVal floatopacity)
Floatjpegopacity = floatopacity
End Property

Private Sub Class_Initialize
On Error Resume Next

Intimagewidth = 0
Intimageheight = 0
strmessage = ""
Flagopen = False
Intjpegcolor = &hffffff
strjpegfamily = "Arial"
Flagjpegbold = True
Intjpegsize = 20
floatjpegopacity = 1

Intjpegwidth = 0
Intjpegheight = 0

Set objjpeg = Server.CreateObject ("Persits.jpeg")
If Err Then
Set objjpeg = Nothing
Message = "Component Persits.jpeg not installed!" "
Exit Sub
End If

Message = ""
Set objFSO = Server.CreateObject ("Scripting.FileSystemObject")
If Err Then
Set objFSO = Nothing
Message = "Component Scripting.FileSystemObject not installed!" "
Exit Sub
End If
End Sub

' Open File strFileName
Public function open (strFileName)
Open = False
Message = ""
If not Fileisopen then
On Error Resume Next
If Objfso.fileexists (Server.MapPath (strFileName)) Then
Objjpeg.open Server.MapPath (strFileName)
If Err Then
Message = err.description& "<br>"
Exit function
End If
Intimagewidth = Objjpeg.originalwidth
Intimageheight = Objjpeg.originalheight
Open = True
Flagopen = True
Message = "File opened successfully!" "
Else
Message = "file does not exist!" "
End If
Else
Message = "File is open!" "
End If
End Function

' Save to file DestFile
Public Sub SaveAs (DestFile)
Message = ""
On Error Resume Next
If Fileisopen Then
Objjpeg.save Server.MapPath (DestFile)
If Err Then
message = Err.Description
End If
Else
Message = "File has been saved!" "
End If
End Sub

' Close Object
Public Sub Close ()
On Error Resume Next
If Fileisopen Then
Objjpeg.close
Flagopen = False
End If
End Sub

Home 1 2 3 last

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.