Ver Mensaje Individual
  #2  
Antiguo 05-11-2004
frudolph frudolph is offline
Miembro
 
Registrado: oct 2004
Posts: 40
Reputación: 0
frudolph Va por buen camino
En el evento "OnDrawColumnCell" de la grilla (DBGrid) escribe más o menos lo que sigue:


Código:
procedure TForm1.DBGrid1DrawColumnCell(
	Sender: TObject; const Rect: TRect; DataCol: Integer;
	Column: TColumn; State: TGridDrawState);
var
  P: TPicture;
begin
  P := TPicture.Create;
  try
	with TDBGrid(Sender) do
	  // En la linea que sigue reemplaza "GRAPHIC" por tu nombre de campo
	  if not (gdFixed in State) and (UpperCase(Column.FieldName) = 'GRAPHIC') then
		begin
		  Canvas.FillRect(Rect);
		  P.Assign(Column.Field);
		  if P.Graphic <> nil then Canvas.StretchDraw(Rect, P.Graphic)
		end;
  finally
	P.Free;
  end;
Responder Con Cita