?
Solved

Bitmaps in StringGrid

Posted on 1998-10-03
3
Medium Priority
?
387 Views
Last Modified: 2011-09-20
I understand that Bitmaps can be displayed in a cell of a Stringgrid, How ??

i have tried using 'objects' method, but I get an error message that I have not seen in a documentation 'EStringSparseListError'

can anyone suggest some code  ?
0
Comment
Question by:chriseden
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 210 total points
ID: 1341582
Hi chriseden,

here is the code :

In your StringGrid's OnDrawCell event handler, place some code that resembles:

     with StringGrid1.Canvas do        begin        {...}
        Draw(Rect.Left, Rect.Top, Image1.Picture.Graphic);        {...}
        end;

Regards, Zif.
0
 
LVL 5

Expert Comment

by:scrapdog
ID: 1341583
Maybe this will help???


procedure TForm1.StringGrid1DrawCell(Sender: TObject; Col, Row: Longint;
  Rect: TRect; State: TGridDrawState);
 
begin
  if StringGrid1.Objects[Col,Row] is TImage then begin
    with StringGrid1.Canvas do begin
      Draw(Rect.Left, Rect.Top, (StringGrid1.Objects[col,row] as TImage).Picture.Graphic);        {
    end;

  end;
end;


0
 

Author Comment

by:chriseden
ID: 1341584
Great
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month11 days, 9 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question