T
terry_zhou82
Unregistered / Unconfirmed
GUEST, unregistred user!
我的代码如下1.procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; 2. DataCol: Integer; Column: TColumn; State: TGridDrawState); 3.var 4. Bmp: TBitmap; 5.begin 6. DBGrid1.Canvas.FillRect(Rect); 7. if Column.FieldName = 'photo' then 8. begin 9. try 10. Bmp := TBitmap.Create; 11. Bmp.LoadFromFile('c:/down.bmp'); 12. DBGrid1.Canvas.StretchDraw(Rect,Bmp); 13. finally 14. Bmp.Free; 15. end; 16. end; 17.end; 18.end. 但为什么我添加进来的图片会占用很大的列,文件本身很小啊16x16的,我也调整了。DBGRID里面的列宽。还不行,而且添加的图片为什么也不是透明的,头大啊。