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 


[C++]Loading an image from a file?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Sun Sep 07, 2008 10:38 am    Post subject: [C++]Loading an image from a file? Reply with quote

I'm trying to load an image from a file for a static control with the SS_BITMAP style, but LoadImage only gets the image from the resources, I never used them before, I tried adding the file to "Resourses" folder (filter) but I guess that it isn't enough.

How can I load an image from a file or add one to resources?
Back to top
View user's profile Send private message
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Sun Sep 07, 2008 11:28 am    Post subject: Reply with quote

open .bmp in binary, copy the bitmap into a bitmap variable (or whatever it is).
_________________
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sun Sep 07, 2008 12:44 pm    Post subject: Reply with quote

put the image in the project folder where the source is. Create a new rc.

#define IMAGE 4000

(resource.h)

IMAGE BITMAP DISCARDABLE "image.bmp"

(resource.rc)


IMAGE is changed to w/e and image.bmp is your image name.



Then just load the image (you can find how on forgers win32 tut)

_________________
Back to top
View user's profile Send private message
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Sun Sep 07, 2008 1:02 pm    Post subject: Reply with quote

That isn't an option if he wants to do it programatically (say to get user inputted images).

http://support.microsoft.com/kb/158898

_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Sep 07, 2008 3:03 pm    Post subject: Reply with quote

Using LoadImage with the IMAGE_BITMAP parameter, and LR_LOADFROMFILE flag should work.
_________________
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Mon Sep 08, 2008 9:22 am    Post subject: Reply with quote

Thanks everyone, I'll try it.

Edit: thanks lurc, I didn't see that option in MSDN.
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