Ver Mensaje Individual
  #1  
Antiguo 13-06-2011
Rofocale Rofocale is offline
Miembro
 
Registrado: mar 2010
Posts: 182
Reputación: 17
Rofocale Va por buen camino
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
Responder Con Cita