AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Grafik in DBGrid

Ein Thema von bwolf · begonnen am 20. Mai 2009 · letzter Beitrag vom 20. Mai 2009
 
bwolf

Registriert seit: 17. Jan 2006
368 Beiträge
 
Delphi 2009 Professional
 
#1

Grafik in DBGrid

  Alt 20. Mai 2009, 10:14
Hi Leute,

ich möchte in einem DBGrid in einer Zelle statt des Textes eine Grafik anzeigen.
Mit diesem Code von delphi.about.com wird schonmal eine Grafik zusätzlich vor dem Text angezeigt:

Delphi-Quellcode:
  // dbgridDrawColumnCell
  if (Column.Field.FieldName = 'name') then
  begin
    bitmap := TBitmap.Create;
    try
      //grab the image from the ImageList
      ImageList1.GetBitmap(0,bitmap);
      //Fix the bitmap dimensions
      bmpWidth := (Rect.Bottom - Rect.Top);
      fixRect.Right := Rect.Left + bmpWidth;
      //draw the bitmap
      dbgrid.Canvas.StretchDraw(fixRect,bitmap);
    finally
      bitmap.Free;
    end;
      // reset the output rectangle,
      fixRect := Rect;
      // add space for the graphics
      fixRect.Left := fixRect.Left + bmpWidth;
  end;
Ich probiere nun seit geraumer Zeit den Text zu entfernen, schaffs aber nicht so wirklich.
Kann mir da einer auf die Sprünge helfen?

Danke euch!
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:39 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz