一、API声明: SUBROUTINE CopyMemory(ref METAHEADER Destination , ref blob Source, long Length) LIBRARY "kernel32" Alias for "RtlMoveMemory" SUBROUTINE CopyMemory2(ref blob Destination , ref blob Source, long Length) LIBRARY "kernel32" Alias for "RtlMoveMemory" Function ulong SetMetaFileBitsEx(ulong nSize,ref blob lpData) LIBRARY "gdi32.dll" 二、PB脚本: METAHEADER lst_Hdr integer li_FileNum Long ll_hMF,ll_loops,ll_pos,ll_len blob lb_structure,lb_da...
本文拟结合POWERBUILDER语言,简述如何实现图片透明叠加效果,本例参考并改编了以前流传甚广的一篇VB文章,由于时间太久,源出处已无从查找,在此向原作者致意。程序效果图见:http://blog.csdn.net/images/blog_csdn_net/balloonman2002/17312/r_PIC_OVERLAP.JPG一、基本思路程序的原理是先创建两个用于起屏蔽作用的模板DC(装载单色掩码位图,且这二者正好是相反的关系,通过NotSrcCopy实现),分别与源DC和目标DC进行与操作(SrcAnd),这时就能将源DC和目标DC中要透明的区域和不要透明的区域正好各自划分成黑色部分(即象素颜色为0)(具体为源DC中透明区域为黑色,目标DC中不要透明区域为黑色...
$uptypes=array('image/jpg','image/jpeg','image/pjpeg','image/gif');//上传图片文件类型列表$wFile="a.jpg";//取得文件路径$waterimg="hq.gif";//水印图片路径if(in_array($wFile['type'], $uptypes)){//检查文件类型,若上传的文件为jpg或gif图片则加水印if(strstr($wFile['type'],"jp")){ //若上传图片类型为jpg,pjpeg,jpeg,则用imagecreatefromjpeg读取目标文件$im = imageCreatefromjpeg($wFile);$wfilew=imagesx($im);//取得图片的宽$wfileh=imagesy($im);//取得图片的高}else{//否则若上传图片类型为gif,则用imagecreatefromgif读取目标文件$im = imageCreatefromgif($wFile);$wfilew=imagesx($...
作用:将页面中的电话号码生成图片格式。 <% Call Com_CreatValidCode(Request.QueryString("tel")) Public Sub Com_CreatValidCode(pTel) '----------禁止缓存 Response.Expires = 0 Response.AddHeader "Pragma","no-cache" Response.AddHeader "cache-ctrol","no-cache" Response.ContentType = "Image/BMP" Randomize Dim i, ii, iii ,rndColor,strLen,sql,rs Const cOdds = 5 '------------杂点出现的机率 Const str="0123456789-" strLen = len(pTel) rndColor = ChrB(cint(rnd*255)) & ChrB(cint(rnd*255)) ...
Dim url, body, myCacheurl = Request.QueryString("url")Set myCache = new cachemyCache.name = "picindex"&urlIf myCache.valid Thenbody = myCache.valueElsebody = GetWebData(url)myCache.add body,dateadd("d",1,now)End IfIf Err.Number = 0 ThenResponse.CharSet = "gb2312"Response.ContentType = "application/octet-stream"Response.BinaryWrite bodyResponse.FlushElseWscript.Echo Err.DescriptionEnd if'取得数据Public Function GetWebData(ByVal strUrl)Dim curlpathcurlpath = Mid(strUrl,1,Instr(8,strUrl,&quo...
saveimg("http://dl_dir.qq.com/qqfile/qq/QQ2008stablehij/QQ2008KB3.exe")function saveimg(imgfileurl)dim img_type,savepath,imgfiletype,flag,imgbodysavepath="photo" '本地路径flag=falseimgfiletype=right(imgfileurl,4)'获取远程图片的格式img_type=".gif|.bmp|.jpg|.png|.exe|"'设置允许保存在本地的图片(文件)格式typeArr=split(img_type,"|")for i=0 to ubound(typeArr)-1if LCase(imgfiletype)=typeArr(i) thenflag=trueexit forend ifnextif flag=false then'如果不是允许保存到本地的图片格式,则只连接远程图片saveimg=imgfileurlelseset xml_http=server.createobject(&quo...