Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   DevExpress como puedo poner imagen en listbox (https://www.clubdelphi.com/foros/showthread.php?t=74344)

Rofocale 13-06-2011 20:52:24

DevExpress como puedo poner imagen en listbox
 
hola a todos alguien que use devexpress y haya utilizado el listbox para ponerle imagenes ?

Código Delphi [-]
var
  Bitmap: TBitmap;      { Temporary variable for the item�s bitmap }
  Offset: Integer;      { Text offset width }
begin
  Bitmap := TBitmap.Create;
  with (Control as TListBox).Canvas do  { Draw on control canvas, not on the form. }
  begin
    FillRect(Rect);       { Clear the rectangle. }
    Offset := 2;          { Provide default offset. }
    Bitmap := TBitmap((Control as TListBox).Items.Objects[Index]);  { Get the bitmap. }
    if Bitmap <> nil then
    begin
      BrushCopy(
        Bounds(Rect.Left + Offset, Rect.Top, Bitmap.Width, Bitmap.Height),
        Bitmap, 
        Bounds(0, 0, Bitmap.Width, Bitmap.Height), 
        clRed);  {render bitmap}
      Offset := Bitmap.width + 6;    { Add four pixels between bitmap and text. }
    end;
    TextOut(Rect.Left + Offset, Rect.Top, (Control as TListBox).Items[Index])  { Display the text. }
  end;
end;

este codigo normalmente es para un listbox normal pero en el listbox de las devexpress no existe textout y brushcopy

espero alguien las haya utilizado y me pueda ayudar gracias


La franja horaria es GMT +2. Ahora son las 12:39:43.

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