delphi 请问 下面是根据BMP图生成透明窗口的代码,为何窗口不透明?而且是
请问下面是根据BMP图生成透明窗口的代码,为何窗口不透明?而且是黑乎乎的,如何把只把图像显示出来?procedureTForm1.FormCreate(Sender:TO...
请问 下面是根据BMP图生成透明窗口的代码,为何窗口不透明?而且是黑乎乎的,如何把只把图像显示出来?procedure TForm1.FormCreate(Sender: TObject);varh,w,i,j,lTcolor;hrgn1,hrgn3:HRGN;begin tc:=image1.Canvas.Pixels[0,0]; h:=image1.Canvas.ClipRect.Bottom -image1.Canvas.ClipRect.top ; w:=image1.Canvas.ClipRect.Right -image1.Canvas.ClipRect.left ; hrgn3:=createrectrgn(0,0,w,h); //showmessage(inttostr(h)+' '+inttostr(w)); try for i0 to w-1 do for j0 to h-1 do begin if image1.Canvas.Pixels[i,j]=tc then begin //beep(); deleteobject(hrgn1); hrgn1:=CreateRectRgn(i,j,i+1,j+1); if hrgn1<>0 then begin CombineRgn(hrgn3,hrgn3,hrgn1,RGN_DIFF); end; end; end; deleteobject(hrgn1); setwindowrgn(form1.handle,hrgn3,true); except showmessage('error'); end;end;
展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询