Ver Mensaje Individual
  #3  
Antiguo 19-04-2014
camiz camiz is offline
Miembro
 
Registrado: ene 2012
Posts: 69
Reputación: 13
camiz Va por buen camino
ecfisa, me diste justo la respuesta correcta que necesitaba, gracias por tomarte el tiempo en responder mi inquietud. Gracias amigo.

adaptandolo a mi proyecto quedo asi, por si acaso a alguien le hace falta.

Código Delphi [-]
var
  i: Integer;
  it: TListItem;
  B: TBitmap;
  P: TPNGObject;
begin
  with Query do
  begin
   SQL.Clear;
   SQL.Text := 'select * from img order by idimg asc';
   Active := True;

  First;
  for i:= 0 to RecordCount -1 do
  begin
    it:= ListView1.Items.Add;
    it.Caption := '   '+FieldByName('NOMBRE').AsString;
    it.ImageIndex:= i;
    P:= TPNGObject.Create;
    B:= TBitmap.Create;
    try
      P.Assign(TBlobField(FieldByName('IMAGEN')));
      B.Width:= P.Width;
      B.Height:= P.Height;
      B.PixelFormat:= pf24bit;
      P.Draw(B.Canvas, Rect(0, 0, P.Width, P.Height));
      ImageList1.Add(B, B);
    finally
      P.Free;
      B.Free;
    end;
    Next;
  end;
  ListView1.LargeImages:= ImageList;
  end;
Responder Con Cita