我 有 一 張 圖片..不規則的...
我想讓它只顯示不規則圖片..

解决方案 »

  1.   

        用 1stclass 控件组吧,很方便,用TfcImage控件
      

  2.   

    airhorse(编程至尊宝) :
    能具體一點嗎..
      

  3.   

    Kingron(WinAPI) ;
    能具體一點嗎.. 
      

  4.   

    coldljy(凤舞N天):
    窗體的背景色還在 呀....
      

  5.   

    Venus控件组中,有一个oxForms控件,只要放上一个不规则图片(.bmp),马上变成不规则窗体,一句代码都不用写,很酷的。 :)
      

  6.   

    也许下面两个属性设置对你有所帮助的,该窗体的刷新问题可不是好解决的了:
    1. Form1.Brush.Style:= bsClear
    2. Form1.BorderStyle:= bsNone
      

  7.   

       去下载一个叫 1stclass 的界面增强控件,还有infopower数据库增强控件。很管用的。
       我有注册码。
      

  8.   

    在窗体的 Create 中加上:
      SetWindowLong(窗体名.Handle,GWL_EXSTYLE,WS_EX_TRANSPARENT);
      

  9.   

    我来贴一段代码!
    你去试一试!!很管用的哦,真正的透明!
    Procedure TForm1.FormCreate (Sender: TObject);
    Var
    FullRgn, ClientRgn, ButtonRgn: THandle;
    LeftMargin, TopMargin, Margin, X, i: integer;
    Begin
      Margin: = (Width - ClientWidth) div 2;
      FullRgn: = CreateRectRgn (0, 0, Width, Height);
      LeftMargin: = Margin;
      TopMargin: = Height - ClientHeight - Margin;
      ClientRgn: = CreateRectRgn (LeftMargin, TopMargin, LeftMargin + ClientWidth, TopMargin + ClientHeight);
      CombineRgn (FullRgn, FullRgn, ClientRgn, RGN_DIFF);
      For i: = 0 to ComponentCount-1 do
       Begin
         If not (Components [i] is TWinControl) then continue;
         If (Components [i] as TWinControl). Parent<>self then continue;
         X: = LeftMargin + (Components [i] as TWinControl). Left;
         Y: = TopMargin + (Components [i] as TWinControl). Top;
         ButtonRgn: = CreateRectRgn (X, Y, X + (Components [i] as TWinControl). Width, Y + (Components [i] as TWinControl). Height);
         CombineRgn (FullRgn, FullRgn, ButtonRgn, RGN_OR);
       End;
    SetWindowRgn (Handle, FullRgn, True);
    End;
      

  10.   

    用 this.Brush.Style := bsClear 试试;
    在CB中我可成功乐的!
      

  11.   

    1 在FromCreate 
    Canvas.Brush.Style:=bsClear;
    2 重载 CreateParams方法;
     Inherit CREATEPARAMS(PARAMS);
     
      

  12.   

    调API!!选择一个Region,然后把窗口边缘设为这个Region
      

  13.   

    coolform也可以。不过我反对控件主义。
    这点应该可以用Mask搞定吧。
      

  14.   

    rehuo(热火) :
    不行呀...
    我看不到圖片了......
      

  15.   

    rehuo(热火) :
    是 這樣的...
    案你的方法可以..不過我打開別的窗口就 會有背景出現...
    如;我打開word..再關掉word..圖片就 會有背景出現.....
      

  16.   

    试试我的代码:
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      ExtCtrls, StdCtrls, Buttons;type
      TForm1 = class(TForm)
        Image1: TImage;
        Button1: TButton;
        procedure FormCreate(Sender: TObject);
        procedure Button1Click(Sender: TObject);
        procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
          Shift: TShiftState; X, Y: Integer);
      private
        function CreateRegion(wMask: TBitmap; wColor: TColor;
          hControl: THandle): HRGN;
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}function Tform1.CreateRegion(wMask:TBitmap;wColor:TColor;hControl:THandle): HRGN;
    var
      dc, dc_c: HDC;
      rgn: HRGN;
      x, y: integer;
      coord: TPoint;
      line: boolean;
      color: TColor;
    begin
      dc := GetWindowDC(hControl);
      dc_c := CreateCompatibleDC(dc);
      SelectObject(dc_c, wMask.Handle);
      BeginPath(dc);
      for x:=0 to wMask.Width-1 do
      begin
        line := false;
        for y:=0 to wMask.Height-1 do
        begin
          color := GetPixel(dc_c, x, y);
          if not (color = wColor) then
          begin
            if not line then
            begin
              line := true;
              coord.x := x;
              coord.y := y;
            end;
          end;
          if (color = wColor) or (y=wMask.Height-1) then
          begin
            if line then
            begin
              line := false;
              MoveToEx(dc, coord.x, coord.y, nil);
              LineTo(dc, coord.x, y);
              LineTo(dc, coord.x + 1, y);
              LineTo(dc, coord.x + 1, coord.y);
              CloseFigure(dc);
            end;
          end;
        end;
      end;
      EndPath(dc);
      rgn := PathToRegion(dc);
      ReleaseDC(hControl, dc);
      Result := rgn;
    end;procedure TForm1.FormCreate(Sender: TObject);
    var
      w1:TBitmap;
      w2:TColor;
      rgn: HRGN;
    begin
      w1:=TBitmap.Create;
      w1.Assign(image1.Picture.Bitmap);
      w2:=w1.Canvas.Pixels[0,0];
      rgn := CreateRegion(w1,w2,Handle);
      if rgn<>0 then
      begin
         SetWindowRgn(Handle, rgn, true);
      end;
      w1.Free;
    end;procedure TForm1.Button1Click(Sender: TObject);
    begin
      Close;
    end;procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    begin
      ReleaseCapture;
      SendMessage(Handle, WM_SYSCOMMAND, $F012, 0);
    end;end.