Does any know how to put images in a TDrawGrid In C++ Builder?

Started by
5 comments, last by Dark_Icer 20 years, 8 months ago
Greetings! I am trying to make a RPD 2D Tile-base Map Editor Similar to RPG Maker 95/98/2000/2003. I''ve also posted previously with my source code here: http://gamedev.net/community/forums/topic.asp?topic_id=175379 If anybody can figure out the problem in either Delphi or C++ Builder it would be helpfull. I don''t Pascal or Delphi we''ll but I do understad enough of it to convert it to c++ just by looking at Delphi code. Just because some one is new to something does not me that they shoud not try to do something big with it, after all trail and error is what build experence and experence built is experence gain.
Signed - Tne Nevermelting Icer - Dark Icer
Advertisement
Oh and I move the code to ondrawcell event

Just because some one is new to something does not me that they shoud not try to do something big with it, after all trail and error is what build experence and experence built is experence gain.
Signed - Tne Nevermelting Icer - Dark Icer
here you go ( in delphi )

procedure TForm1.DrawGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
DrawGrid1.Canvas.StretchDraw(Rect,Image1.Picture.Bitmap);
end;

Hope it helps

Mark.

I looked at your code and I think your problem is you are drawing it in the OnDrawCell event. You shouldn''t draw all of the cells, just the one that is updating. Or move your drawing into a timer or something. Or you could do it during the OnIdle event of TApplication.
I just saw your post at bytamin-c.

Post some code about your saving function, since that is what is crashing your editor.
C++ Builder would Crash when ever I attempt to save the project when the TImageList width is 192 and height is 1024. I''m going to try it with delphi too
Signed - Tne Nevermelting Icer - Dark Icer
There might be an internal limit that the image list supports for it''s images sizes. Search borland''s site to see if you can come up with anything.

Why not just get rid of the ImageList and use a linked list instead to store the bitmaps? That way you have more control over the info for each image. This is what I do for my map editor. Builder has a great linked list class, TList, that makes this very easy.

This topic is closed to new replies.

Advertisement