Solved

Bitmaps in StringGrid

Posted on 1998-10-03
3
381 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
3 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 70 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
code issue 8 184
Mobile Keyboard covers the display of the TMemo 3 102
drawing animated level bar based on numbers 3 112
Problem working with dynamic array - help 2 35
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 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