我的目的就是做成相框一样 但是周边都是图片 可以改变大小 的panel  
四个角可以是直角也可以是圆角, 已经实现直角,但是圆角的
实现不了,我做这步的目的是把图片变成圆环,然后放进bitmap里 然后切成4份去做圆角
但是我在编写vcl时,放置了一个新的panel变成了圆环,但是保存不了bmp,所以进行不下了 ,郁闷
请高手指点!!!
我的思路是不是有问题,有谁有别的思路的吗?
procedure TBorderImagePanel.DrawPanelArc;
var
  x, y: HRgn;
  bit: tBitmap;
  tmppanel: TPanel;
  aimage: TImage;
  w: Integer;
  SourRect: TRect;
  DC: HDC;
  can: TCanvas;
begin  w := Self.BorderWidth;  try    begin      tmppanel := TPanel.Create(nil);
      tmppanel.Parent := Self;
      tmppanel.Width := 100;
      tmppanel.Height := 100;
      tmppanel.Top := 20;
      tmppanel.Left := 20;
      tmppanel.Visible := True;
      tmppanel.Enabled := True;      aimage := TImage.Create(nil);
      aimage.Parent:= tmppanel;
      aimage.Align := alClient;
      aimage.Picture.Bitmap.LoadFromResourceName(HInstance, 'GROUNDBMP');      SourRect:= tmppanel.ClientRect;
      bit := TBitMap.Create;
      bit.PixelFormat := pf24bit;
      bit.Width := SourRect.Right;
      bit.Height := SourRect.Bottom;      can:= TCanvas.Create;
      DC := GetDC (tmppanel.Handle);
      can.Handle := DC;      x := CreateEllipticRgn(0, 0, tmppanel.Width, tmppanel.Height);
      y := CreateEllipticRgn(w, w, tmppanel.Width - w, tmppanel.Height - w);
      CombineRgn(y, x, y, RGN_XOR);
      SetWindowRgn(tmppanel.Handle, y, True);
      bit.Canvas.CopyRect(SourRect,can,Rect(0,0,100,100) );
      bit.SaveToFile('C:\MyPic.bmp');
    end;
  finally
    aimage.Free;
    tmppanel.Free;
  end;end;