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 


.Net ~screenshot help~

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

Joined: 01 Aug 2007
Posts: 1257

PostPosted: Sun Jun 22, 2008 9:59 pm    Post subject: .Net ~screenshot help~ Reply with quote

Edit 2: FIXED
Code:
Me.Hide()
Threading.Thread.Sleep(500)

YESSSSSSSSSSSSSSSS!!!!!!!!!!!!!!!!!!!!!!!!


Edit: Okay this is really weird, when I hit the "take screenshot" button like 5 times in a row, the 5th time I press it, it doesnt take a picture of the program. I changed the "Me.Visible = True" to "Me.Hide".


This is the code I made to take a screenshot in VB:

Code:
 Me.Visible = False
        Dim bounds As Rectangle
        Dim screenshot As System.Drawing.Bitmap
        Dim graph As Graphics
        bounds = Screen.PrimaryScreen.Bounds
        screenshot = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppPArgb)
        graph = Graphics.FromImage(screenshot)
        graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
        PictureBox1.Image = screenshot
        Me.Visible = True


Although, its still taking a picture of the program itself, and I need the program "to go away" somehow, and re-appear after the screenshot.

Help?

_________________


Last edited by AndrewMan on Sun Jun 22, 2008 11:29 pm; edited 4 times in total
Back to top
View user's profile Send private message
Overload
Master Cheater
Reputation: 0

Joined: 08 Feb 2008
Posts: 293

PostPosted: Sun Jun 22, 2008 10:01 pm    Post subject: Reply with quote

make it hide in the tray or something, then use hotkeys to take the screen shot?
Back to top
View user's profile Send private message MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Jun 22, 2008 10:32 pm    Post subject: Reply with quote

Didn't you ask this before and got answered? (I swear this has been asked before with that code.)
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
AndrewMan
Grandmaster Cheater Supreme
Reputation: 0

Joined: 01 Aug 2007
Posts: 1257

PostPosted: Sun Jun 22, 2008 10:41 pm    Post subject: Reply with quote

Wiccaan wrote:
Didn't you ask this before and got answered? (I swear this has been asked before with that code.)


Yeah, never got answer though (was looking through some of my projects, and bumped into this one).

Thought id give another thread a try.

_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Jun 22, 2008 11:05 pm    Post subject: Reply with quote

Based on what I can find on Google and various VB sites, Me.Hide() should do what you need to get the form to hide when that function is called. So:

Code:
Me.Hide()
// Other Code Here...
Me.Show()

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
AndrewMan
Grandmaster Cheater Supreme
Reputation: 0

Joined: 01 Aug 2007
Posts: 1257

PostPosted: Sun Jun 22, 2008 11:08 pm    Post subject: Reply with quote

Wiccaan wrote:
Based on what I can find on Google and various VB sites, Me.Hide() should do what you need to get the form to hide when that function is called. So:

Code:
Me.Hide()
// Other Code Here...
Me.Show()


I dont know whats going on. It works "sometimes"....

Getting so damn tired of this stupid .Net shit.

Edit:
Code:
Threadstate.wait
and
Code:
threadstate.standby

may work, just gotta figure out how to use them.

_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun Jun 22, 2008 11:19 pm    Post subject: Reply with quote

AndrewMan wrote:
Wiccaan wrote:
Based on what I can find on Google and various VB sites, Me.Hide() should do what you need to get the form to hide when that function is called. So:

Code:
Me.Hide()
// Other Code Here...
Me.Show()


I dont know whats going on. It works "sometimes"....

Getting so damn tired of this stupid .Net shit.


That's what debuggers are for.

Also, real men write native code.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Jun 22, 2008 11:23 pm    Post subject: Reply with quote

Sometimes might just because it is happening too fast. Trying adding Sleeps, not long ones, after the first call to hide the form. Such as:

Code:
Me.Hide()
Sleep( 100 )
// Other code...
Me.Show()


Giving the form a chance to hide before taking the pic.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
AndrewMan
Grandmaster Cheater Supreme
Reputation: 0

Joined: 01 Aug 2007
Posts: 1257

PostPosted: Sun Jun 22, 2008 11:28 pm    Post subject: Reply with quote

Wiccaan wrote:
Sometimes might just because it is happening too fast. Trying adding Sleeps, not long ones, after the first call to hide the form. Such as:

Code:
Me.Hide()
Sleep( 100 )
// Other code...
Me.Show()


Giving the form a chance to hide before taking the pic.


Yup just figured it out. Was playing around with Threading Very Happy

Im so damn happy now.

Code:
Me.Hide()
Threading.Thread.Sleep(500)
\\code
Me.show

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

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Mon Jun 23, 2008 6:17 pm    Post subject: Reply with quote

That doesn't seem like it would matter.

I've done things like

Code:

OtherForm otherForm = new OtherForm();
this.Hide();
otherForm.ShowDialog();
this.Show();


And has never not worked.

Also, as Slovach mentioned, you should try to make use of Visual Studio's amazing debugging feature.

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
AndrewMan
Grandmaster Cheater Supreme
Reputation: 0

Joined: 01 Aug 2007
Posts: 1257

PostPosted: Mon Jun 23, 2008 6:36 pm    Post subject: Reply with quote

samuri25404 wrote:
That doesn't seem like it would matter.

I've done things like

Code:

OtherForm otherForm = new OtherForm();
this.Hide();
otherForm.ShowDialog();
this.Show();


And has never not worked.

Also, as Slovach mentioned, you should try to make use of Visual Studio's amazing debugging feature.


Just doesnt work with .Net

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

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Mon Jun 23, 2008 6:38 pm    Post subject: Reply with quote

AndrewMan wrote:
samuri25404 wrote:
That doesn't seem like it would matter.

I've done things like

Code:

OtherForm otherForm = new OtherForm();
this.Hide();
otherForm.ShowDialog();
this.Show();


And has never not worked.

Also, as Slovach mentioned, you should try to make use of Visual Studio's amazing debugging feature.


Just doesnt work with .Net



That was C#...

In case you didn't know, C# is part of the .NET framework... >_>

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
AndrewMan
Grandmaster Cheater Supreme
Reputation: 0

Joined: 01 Aug 2007
Posts: 1257

PostPosted: Mon Jun 23, 2008 6:41 pm    Post subject: Reply with quote

samuri25404 wrote:
AndrewMan wrote:
samuri25404 wrote:
That doesn't seem like it would matter.

I've done things like

Code:

OtherForm otherForm = new OtherForm();
this.Hide();
otherForm.ShowDialog();
this.Show();


And has never not worked.

Also, as Slovach mentioned, you should try to make use of Visual Studio's amazing debugging feature.


Just doesnt work with .Net



That was C#...

In case you didn't know, C# is part of the .NET framework... >_>


I dont know maybe my vb 2008 is glitched or somethin

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

Joined: 27 Mar 2008
Posts: 175
Location: Wales

PostPosted: Tue Jun 24, 2008 4:47 am    Post subject: Reply with quote

Try minimizing the form instead of hiding it.
Back to top
View user's profile Send private message
AndrewMan
Grandmaster Cheater Supreme
Reputation: 0

Joined: 01 Aug 2007
Posts: 1257

PostPosted: Tue Jun 24, 2008 12:23 pm    Post subject: Reply with quote

Guys i've already figured this out lol. I just sleep it.
_________________
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