在Speedbutton平铺了一张图片后,如何将Caption的文字置于图片上

解决方案 »

  1.   

    SpeedButton Layout:=blGlyphBottom
      

  2.   

    設置它的 layout := blGlyphBottom
      

  3.   

    你把SpeedButton的属性Flat设置为True试一下
      

  4.   

    感觉LZ放了100分,不会是要象LS所说的这么简单的效果吧
    是想在显示的图片上显示文字吧?
      

  5.   

    不失为一个好办法:procedure TForm1.FormCreate(Sender: TObject);
    var
      I: Integer;
    begin
      for I := 0 to ComponentCount - 1 do
        if Components[I] is TSpeedButton then
          with TSpeedButton(Components[I]) do
          begin
            Glyph.Canvas.Brush.Style := bsClear;
            Glyph.Canvas.TextOut(2, 2, Caption);
            Caption := '';
          end;
    end;
      

  6.   

    或者不设置Caption,用Hint代替:procedure TForm1.FormCreate(Sender: TObject);
    var
      I: Integer;
    begin
      for I := 0 to ComponentCount - 1 do
        if Components[I] is TSpeedButton then
          with TSpeedButton(Components[I]) do
          begin
            Glyph.Canvas.Brush.Style := bsClear;
            Glyph.Canvas.TextOut(2, 2, Hint);
          end;
    end;
      

  7.   

    是的,现在通过:FlatSpeedButton0.Glyph.Canvas.TextOut(10,35,'痞子酷');可以显示文字,
    但是显示的文字的区域有背景,怎么把文字的背景颜色去掉?
      

  8.   

    试了下,楼上代码可用,但若如layout := blGlyphBottom ,我还没看到CAPTION。
      

  9.   

    我是要在显示的图片上显示文字吧!!!!现在通过:FlatSpeedButton0.Glyph.Canvas.TextOut(10,35,'痞子酷');可以显示文字, 
    但是显示的文字的区域有背景,怎么把文字的背景颜色去掉?
      

  10.   

    你可以使用raize组件,或者使用楼上的方法。
      

  11.   

    SpeedButton Layout:=blGlyphBottom
      

  12.   

    不要背景,canvas.brush.style := bsclear
    就可以了