Ver Mensaje Individual
  #4  
Antiguo 29-05-2007
Avatar de MaMu
MaMu MaMu is offline
Miembro
 
Registrado: abr 2006
Ubicación: Argentina
Posts: 863
Reputación: 21
MaMu Va por buen camino
Hice esto, pero no me dibuja la imagen adentro de la celda, y no se por que me sale este error

Código Delphi [-]
[Warning] Unit2.pas(824): Variable 'icono' might not have been initialized

El cual solucione, cambiando a FALSE el DefaultDrawing del DBGrid, pero aun asi no me dibuja la imagen dentro de la celada

Código Delphi [-]
procedure TFormSubclases.DBGrid1DrawDataCell(Sender: TObject;
  const Rect: TRect; Field: TField; State: TGridDrawState);
var icono: TBitmap;
begin
if Field.Name = 'Icono' 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;

Saludos
__________________
Código Delphi [-]
 
try 
ProgramarMicro(80C52,'Intel',MnHex,True);
except
On Exception do
MicroChip.IsPresent(True);
end;

Última edición por MaMu fecha: 29-05-2007 a las 06:36:33.
Responder Con Cita