>以下源码是快速创建不规则窗体的,还可以移动。
>#ifndef Unit1H- ?& ?5 a _5 q/ a! U/ U* x2 c; I0 d! `
>
>#include <vcl.h>+ H; `: ^' O! \/ [8 ~* J( k
>#include "Unit1.h"6 }! M+ Z) I! L* C9 \( I% \
>void __fastcall TForm1::FormCreate(TObject *Sender)
>BmpToRgn();
>void __fastcall TForm1::Image1MouseDown(TObject *Sender,
ixels[0][0];
>if((a=(POINT *)malloc(Width*2*(sizeof(POINT))))==NULL)
>l=0;r=Image1->Height*2-1;) k/ j" Y$ J2 z# b2 O
>for(y=0;y<Image1->Height;y++)
ixels[x][y]!=ColorKey)3 E8 d6 h, ]) w$ @6 [4 @
> if(lb) a[l]=a[l-1];
> for(x=Image1->Width;x>=0;x--)
ixels[x][y]!=ColorKey)
>r=Image1->Height*2-1;; u4 \5 q& V9 Q. H) o+ w
ixels[x][y]==ColorKey)
><a>Height*2,ALTERNATE">file://TempRgn=CreatePolygonRgn(a,Image1->Height*2,ALTERNATE</A>);
>void __fastcall TForm1::Open1Click(TObject *Sender)
icture->LoadFromFile(OpenPictureDialog1->FileName);4 K5 P8 e& i) J0 d4 `" {
>对啦,图片的背景色要相同。
>file://--------------------(一)为窗体背景增加渐变色(蓝)---------------
>file://---------------透明窗体-------------------------- \* Z, |, L; U' m( B$ h
> ::ScreenToClient(Form1->Handle,lpTL);
> hClient=CreateRectRgn(rctClient->Left,rctClient->Top,
>
>} </P>
| 欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) | Powered by Discuz! X2.5 |