ASP网页编程之aspjpeg减少图片的组件利用先容(2)
当然了,现在国内CRM厂商的产品与其说是CRM,但从至少从我的角度分析上来看,充其量只是一个大型的进销存而已了,了解尚浅,不够胆详评,这里只提技术问题aspjpegAdjustingImageCompression(advancedusersonly)TheJPEGformatuses"lossy"compressionmethods.ThismeansthatsomeminordetailsofanimagesavedasaJPEGarelostduringcompression.Thedegreeoflosscanbeadjustedviathejpeg.Qualityproperty.Thispropertyacceptsanintegerintherange0to100,with0beingthehighestdegreeofloss(andhence,thelowestquality)and100beingthelowestdegreeoflossandhighestquality.
Thelowertheloss,thelargertheresultantfilesize.Thepropertyjpeg.Qualityissetto80bydefaultwhichprovidesaclose-to-optimalcombinationofqualityandfilesize.Changingthispropertyisgenerallynotrecommended.
AspJpegObjectReference
AspJpegProperties
ExpiresAsDate(read-only)
Returnsthecomponentsexpirationdate.Ifavalidregistrationkeyisinstalled,returns9/9/9999.
HeightAsLong(read/write)
Specifiesanewimageheight(inpixels).MustbecalledafteranimageisopenedviatheOpenmethod.
InterpolationAsLong(read/write)
Specifiesanimageresizingalgorithm.Thefollowingvaluesarecurrentlysupported:0(Nearest-Neighbor),1(Bilinear,default)and2(Bicubic).
TheNearest-Neighbor(NN)isthefastestbutprovideslow-qualitythumbnails.
TheBilinearmethodoffersmuchbetterthumbnailqualitybutisapproximately2timesasslowasNN.
TheBicubicmethodisapproximatelytwiceasslowasBilinearand4timesasslowasNN,butsupposedlyoffersthehighestquality.Inmanycases,however,itprovideslittle,ifany,noticeableimprovementovertheBilinearmethod.
Default:1(Bilinear).
OriginalHeightAsLong(read-only)
Returnstheoriginalimageheight(inpixels).CanonlybecalledafteranimageisopenedviatheOpenmethod.Usethispropertytopreservetheoriginalaspectratioofanimage.
OriginalWidthAsLong(read-only)
Returnstheoriginalimagewidth(inpixels).CanonlybecalledafteranimageisopenedviatheOpenmethod.Usethispropertytopreservetheoriginalaspectratioofanimage.
QualityAsLong(read/write)
Specifiesthedegreeofcompressionloss.Affectstheresultantimagequalityandfilesize.
Acceptsanintegervalueintherange0to100,0beingthelowestquality,highestlossandsmallestfilesize.Thehigherthevaluethehighertheimagequality,andthelargerthefilesize.
ThepropertyQualityissetto80bydefaultwhichoffersaclose-to-optimalcombinationofimagequalityandfilesize.Changingthispropertyisgenerallynotrecommended.
WidthAsLong(read/write)
Specifiesanewimagewidth(inpixels).MustbecalledafteranimageisopenedviatheOpenmethod.
AspJpegMethods
SubClose()
ClosesafileopenedviatheOpenmethod.ThismethodiscalledautomaticallyuponthedestructionoftheAspJpegobject,soyoudonothavetocallitexplicitly,unlessthereisanimmediateneedtofreethefilehandle(suchas,ifyouneedtodeletethefile).
SubCrop(x0AsLong,y0AsLong,x1AsLong,y1AsLong)
Cutsedgesoffofathumbnail.Forthismethodtotakeeffect,youmustcallitbeforecalling.Saveor.SendBinary.
Thearguments(x0,y0)and(x1,y1)arethecoordinatesoftheupper-leftandlower-rightcornersofthedesiredcroppedimagewithinthethumbnail.Forexample,iftheoriginallargeimageis300pixelswideand200pixelshigh,thefollowingsequencewillproduceacroppedthumbnailwhichis60pixelswideand40pixelshigh:
Jpeg.Width=120
Jpeg.Height=80
Crop20pixelsfromleft,30fromtop.
Makeimagesize60by40.
Jpeg.Crop20,30,80,70
SubFlipH()
Flipstheresultantthumbnailhorizontally.Forthismethodtotakeeffect,youmustcallitbeforecalling.Saveor.SendBinary.
SubFlipV()
Flipstheresultantthumbnailvertically.Forthismethodtotakeeffect,youmustcallitbeforecalling.Saveor.SendBinary.
SubOpen(PathAsString)
OpensaJPEGimageforresizing.Pathmustbeaphysicalpathtotheimage.
SubSave(PathAsString)
Resizesthecurrentlyopenedimageusingparametersspecifiedbyvariousproperties.SavetheresultantimagethumbnailtoafilespecifiedbyPath.Ifafilewiththisnamealreadyexistsitwillbeoverwritten.
SubSendBinary(OptionalContentDisposition)
Resizesthecurrentlyopenedimageusingparametersspecifiedbyvariousproperties.SendstheresultantimagedirectlytotheclientbrowserbyinternallycallingResponse.BinaryWrite.AutomaticallysetstheContent-Typeheaderto"image/jpeg".
IfContentDisposit</p>源代码保护方面其实现在考虑得没那么多了..NET也可以反编译.ASP写得复杂的话别人能看得懂的话.他也有能力自己写了.这方面担心的倒不太多.纵观现在网上可以下载的那些所谓BBS还有什么网站等等的源代码 代码的可重用性差:由于是面向结构的编程方式,并且混合html,所以可能页面原型修改一点,整个程序都需要修改,更别提代码重用了。 不能只是将它停留在纸上谈兵的程度上。 Server:这个表示的服务器,操作服务器的一些东西使用这个,如Server.Mappath转换服务器路径,Server.CreateObject实例化一个组件 如何学好ASP,以前也有人问过,把回答给你转过来看看能否对你有帮助: 代码的可重用性差:由于是面向结构的编程方式,并且混合html,所以可能页面原型修改一点,整个程序都需要修改,更别提代码重用了。 Response:从字面上讲是“响应”,因此这个是服务端向客户端发送东西的,例如Response.Write 封装性使得代码逻辑清晰,易于管理,并且应用到ASP.Net上就可以使业务逻辑和Html页面分离,这样无论页面原型如何改变,业务逻辑代码都不必做任何改动;继承性和多态性使得代码的可重用性大大提高。 他的语法和设计思路和VB完全相同,导致很多ASP的书都留一句“相关内容请参考VB的相关教材....”更糟糕的是,相当多的ASP教程混合了Javascript,VBscript等等脚本语言,搞的初学者。 先学习用frontpage熟悉html编辑然后学习asp和vbscript建议买书进行系统学习
页:
[1]