Skip to main content
GameDev.net gamedev.net
🔒 Locked

Formats delphi

Started by Pillejunior Mar 8, 2004 at 4:09 PM 5 replies 700+ views
Original Post
Pillejunior
Pillejunior
Can someone point me to a website or such where i can find information where the .bmp and .jpg formats are explained and how i can use them in delphi to save my drawings to that format. I did use google but it gave a lot of links but not the one i am searching for. thanx in advance
Useless Hacker
Useless Hacker
Delphi has support for the bmp format using TBitmap. jpg is supported by the TJPEGImage class, in the JPEG unit. If you are drawing on a TPictureBox for example there are methods for saving to a file. Perhaps you could explain a little more about what you are trying to do?


"The ability to speak does not make you intelligent" - Qui-Gon Jinn
[ DGDev - The Delphi Games Development Community ] [ Help GameDev.net fight cancer ] [ Shareaza - The Ultimate P2P Client ]
iMalc
iMalc
Generally in Delphi I find that you don''t do things like that, you find a package that already has those features in it for you. BMP saving should be easy I think.
Pillejunior
Pillejunior
I draw ellipse/rectangels/etc on the canvas from the listview(because i can''t get the backcolor of the picturebox to white do you know how??) and now i want to save those drawings to those 2 formats and load from them again?
Useless Hacker
Useless Hacker

var
bitmap: TBitmap;
begin
bitmap := TBitmap.Create;
bitmap.Assign(your_canvas);
bitmap.SaveToFile(''whatever.bmp'');
bitmap.Free;
end;

(This code is completely untested)

You can do a similar thing with TJPEGImage.


"The ability to speak does not make you intelligent" - Qui-Gon Jinn
[ DGDev - The Delphi Games Development Community ] [ Help GameDev.net fight cancer ] [ Shareaza - The Ultimate P2P Client ]
Pillejunior
Pillejunior
Thanx i shall try it and tell you if it has worked
Pillejunior
Pillejunior
It seems to work except that it doesn''t take a tcontrolcanvas as input.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.