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#]Getting PictureBox.Image Name

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

Joined: 26 Apr 2008
Posts: 699
Location: -->formerly yoyonerd<--

PostPosted: Sat Jun 06, 2009 7:08 pm    Post subject: [C#]Getting PictureBox.Image Name Reply with quote

So recently I decided to make a BlackJack game program in C#.

However, the only thing I'm having a problem with is comparing a card image, with its represented value.

My first instinct is to compare the image name with resource names to see what card it is. However, I can't figure out how to get a PictureBox's current image name.

Thanks~

_________________
Back to top
View user's profile Send private message AIM Address
FullyAwesome
I post too much
Reputation: 0

Joined: 05 Apr 2007
Posts: 4438
Location: Land Down Under

PostPosted: Sat Jun 06, 2009 8:45 pm    Post subject: Reply with quote

you could always load your images from an imagelist, and store the index value for that card in a variable, and then compare that to another variable (or array index) that has the value of a different card.
_________________
Back to top
View user's profile Send private message MSN Messenger
killersamurai
Expert Cheater
Reputation: 0

Joined: 10 Sep 2007
Posts: 197
Location: Colorado

PostPosted: Sun Jun 07, 2009 1:54 am    Post subject: Reply with quote

Since you're using a picturebox, you will eventually have the location of the image. When ever you have it, you can set the ImageLocation property of the picturebox. I believe it will not be set if it doesn't contain the full location. Since this is a card game, you'll most likely have 52 cards unique cards and it will be easier to store them. I would just create a card class that will store that information then create a deck class that will manage the cards. If you don't want to create classes, you can create a Dictionary and you can determine if it has the key with the key being either the image or value of the card. Either way, you'll have to store the information unless you are using a single image.
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Jun 07, 2009 8:58 am    Post subject: Re: [C#]Getting PictureBox.Image Name Reply with quote

yoyonerd wrote:
So recently I decided to make a BlackJack game program in C#.

However, the only thing I'm having a problem with is comparing a card image, with its represented value.

My first instinct is to compare the image name with resource names to see what card it is. However, I can't figure out how to get a PictureBox's current image name.

Thanks~


Just declare an array of all the images and another variable for the current card. Then render the image based on the value of the current card.
Back to top
View user's profile Send private message
yoyonerd
Grandmaster Cheater
Reputation: 0

Joined: 26 Apr 2008
Posts: 699
Location: -->formerly yoyonerd<--

PostPosted: Sun Jun 07, 2009 5:36 pm    Post subject: Reply with quote

ATM, I already have each image in an array, the problem is they are embedded resources, which means they have no readily available.
_________________
Back to top
View user's profile Send private message AIM Address
iostream
How do I cheat?
Reputation: 0

Joined: 06 Apr 2009
Posts: 9
Location: georgia

PostPosted: Fri Jun 12, 2009 5:03 pm    Post subject: Reply with quote

Did you check in the properties?
Its probably a stupid suggestion considering you're already good with C#

_________________
Don't wait up.
Back to top
View user's profile Send private message MSN Messenger
yoyonerd
Grandmaster Cheater
Reputation: 0

Joined: 26 Apr 2008
Posts: 699
Location: -->formerly yoyonerd<--

PostPosted: Fri Jun 12, 2009 5:09 pm    Post subject: Reply with quote

iostream wrote:
Did you check in the properties?
Its probably a stupid suggestion considering you're already good with C#


Of course I tried, there is none, I had to resort to using a different method, which doesn't allow me to use the images as embedded resources.

_________________
Back to top
View user's profile Send private message AIM Address
iostream
How do I cheat?
Reputation: 0

Joined: 06 Apr 2009
Posts: 9
Location: georgia

PostPosted: Fri Jun 12, 2009 5:56 pm    Post subject: Reply with quote

thats what i figured, glad you figured it out though :p
_________________
Don't wait up.
Back to top
View user's profile Send private message MSN Messenger
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