Con Access, cargadas las imagenes en campos objeto OLE ( o eso creo )
Código Delphi
[-]procedure TFormSubclases.DBGrid1DrawDataCell(Sender: TObject;
const Rect: TRect; Field: TField; State: TGridDrawState);
var icono: TBitmap;
begin
if Field.Name = 'TablaSubclasesdibujo' then
begin
try
icono:= Tbitmap.Create;
icono.Assign(TBlobField(Field));
(Sender as TDBGrid).Canvas.FillRect(Rect);
(Sender as TDBGrid).Canvas.Draw(Rect.left+3,Rect.Top+1, icono);
finally
icono.free;
end;
end
else
(Sender as TDBGrid).DefaultDrawDataCell(Rect, Field, State);
end;
PAra cargar las imagenes a la BBDD, pongo un DBImage asociado al campo y un boton, con este código
Código Delphi
[-]procedure TFormSubclases.BitBtn1Click(Sender: TObject);
begin
with TOpendialog.Create(nil) do
try
Filter:= 'Archivos de imagen|*.bmp;*.ico;*.jpg';
if Execute then
begin
TablaSubclases.Edit;
DBImage1.Picture.LoadFromFile(Filename);
end;
finally
Free;
end;
end;
y ya pinto una imagen en el grid. PAra lo que yo necesito, suficiente. Queda pulir los altos de las filas por si utilizas imagenes de diferentes tamaños, ... pero con eso nunca me he metido.
Suerte y saludos