Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Delphi] Loading an Image and making it appear in Image1

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
kopelito
Master Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 483

PostPosted: Sun Mar 30, 2008 8:15 am    Post subject: [Delphi] Loading an Image and making it appear in Image1 Reply with quote

I mean, I made this OpenDialog button, and I can now load images.
My question is, How can I do it so the loaded Image will appear in TImage?

Thnx.
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Sun Mar 30, 2008 8:32 am    Post subject: Reply with quote

well im not sure how you would do it through the opendialog, but after you load the image, find the directory of that file, then try this

var
fs: TFileStream;

begin
fs := TFileStream.Create('direcorty', fmOpenRead or fmSharedenyNone);
ImageBox1.LoadFromStream(fs);
fs.free

btw i got code from here: http://www.delphitricks.com/source-code/graphic/easily_load_all_kind_of_images_gif_ico_jpeg_and_more_in_a_timage.html

hope this works

_________________
Back to top
View user's profile Send private message
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Sun Mar 30, 2008 8:37 am    Post subject: Reply with quote

Code:
image1.Picture.LoadFromFile(<the file name>);

almost all basic component have this function(TMemo, TStrings, tTreeView, ect...).
Back to top
View user's profile Send private message
kopelito
Master Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 483

PostPosted: Sun Mar 30, 2008 9:16 am    Post subject: Reply with quote

mm and what do I write in the file name?
I cant know what the image name will be.
Back to top
View user's profile Send private message
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Sun Mar 30, 2008 9:33 am    Post subject: Reply with quote

Omg, he made an opendialog..that means:

Code:
if opendialog1.execute then
image1.picture.LoadFromFile(opendialog1.filename);
Back to top
View user's profile Send private message
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Sun Mar 30, 2008 10:08 am    Post subject: Reply with quote

smartz993 wrote:
Omg, he made an opendialog..that means:

Code:
if opendialog1.execute then
image1.picture.LoadFromFile(opendialog1.filename);
I think that if he will think about it little harder he will know the answer...(Its the basic of programing).
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites