Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   Imagen en StringGrid (https://www.clubdelphi.com/foros/showthread.php?t=21350)

Rabata 14-05-2005 00:42:52

Imagen en StringGrid
 
Comp puedo añadir una imagen en un Stringrid (En una Celda)

Lo he intentado de la sguiente forma pero nada.

Código:


          // Cargamos la Imagen...
          Bitmap := TBitmap.Create;
          Try
            With Bitmap Do
            Begin
              Bitmap.LoadFromResourceName(HInstance,'Bandera_Cuadros');
              Transparent := True;
              TransParentColor := BitMap.Canvas.Brush.Color;
              Canvas.Draw(Rect.Left,Rect.Top,BitMap);
              TransparentMode := tmAuto;
            End;
          Finally
            Bitmap.Free;
            // Liberamos la Imagen...
          end;

Gracias a Todos....

Pablo Carlos 14-05-2005 01:41:16

de Trucomania
 
No lo probe pero alli está
Por ejemplo, poner el Image1 en la celda 2,3:

-Pon este código dentro del evento OnDrawCell (Has de tener una imagen cargada en el Image1)


Código Delphi [-]
 procedure TForm1.StringGrid1DrawCell(Sender: TObject; Col, Row: Integer;
   Rect: TRect; State: TGridDrawState);
 begin 
   if (Row=2) and (Col=3) then 
     with StringGrid1.Canvas do 
       Draw(Rect.Left, Rect.Top, Image1.Picture.Graphic);
 end;
Saludos


La franja horaria es GMT +2. Ahora son las 19:28:42.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi