Ver Mensaje Individual
  #2  
Antiguo 12-04-2012
Avatar de defcon1_es
defcon1_es defcon1_es is offline
Miembro
 
Registrado: mar 2004
Ubicación: Cuenca - España
Posts: 533
Reputación: 21
defcon1_es Va por buen camino
Hola.
Creo que no se ve la imagen porque no has sobrecargado el método Paint del TRoundBtn,
y se ejecuta el de la clase TShape, que no tiene en cuenta tu imagen

Prueba algo asi y adáptalo a las necesidades de tu clase.

Código Delphi [-]
...
  protected
    procedure Paint; override;
...

procedure TRoundBtn.Paint;
var
  X, Y, W, H, S: Integer;
begin
  with Canvas do
  begin
    Pen := FPen;
    Brush := FBrush;
    X := Pen.Width div 2;
    Y := X;
    W := Width - Pen.Width + 1;
    H := Height - Pen.Width + 1;
    if Pen.Width = 0 then
    begin
      Dec(W);
      Dec(H);
    end;
    if W < H then S := W else S := H;
    if FShape in [stSquare, stRoundSquare, stCircle] then
    begin
      Inc(X, (W - S) div 2);
      Inc(Y, (H - S) div 2);
      W := S;
      H := S;
    end;
    case FShape of
      stRectangle, stSquare:
        Rectangle(X, Y, X + W, Y + H);
      stRoundRect, stRoundSquare:
        RoundRect(X, Y, X + W, Y + H, S div 4, S div 4);
      stCircle, stEllipse:
        Ellipse(X, Y, X + W, Y + H);
    end;
//El código anterior es el que tiene la clase TShape (Copy&Paste)
    if Assinged(FImagen) then
      StretchDraw(Self.GetClientRect,FImagen.Bitmap);
  end;
end;
__________________
Progress Openedge
https://abevoelker.com/progress_open...dered_harmful/


Delphi forever...
Responder Con Cita