Solved

Bitmaps in StringGrid

Posted on 1998-10-03
3
374 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now