mini screen recorder test code

Post your questions regarding programming in C# in here.
6 posts Page 1 of 1
Contributors
User avatar
volttide
VIP - Donator
VIP - Donator
Posts: 106
Joined: Mon Jan 17, 2011 8:24 am

mini screen recorder test code
volttide
same like vb.net mini screen recorder in youtube

in recscreen (timer) add this code:
Code: Select all
	Size ScreenSize = new Size(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height);
	Bitmap BMP = new Bitmap(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height);
	System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(BMP);
	g.CopyFromScreen(new Point(0, 0), new Point(0, 0), ScreenSize);

	string DirectoryA = FileDIR.Text;
	string Frame1 = FileNUM.Text;
	string img1 = FileType.Text;

	FileNUM.Text = FileNUM.Text + 1;
	BMP.Save(DirectoryA + Frame1 + img1);
in button rec add
Code: Select all
RECScreen.Enabled = true;
FileNUM.Text = "0";
in button stop add:
Code: Select all
RECScreen.Enabled == false
I just convert this code to v csharp
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: mini screen recorder test code
mandai
You only need 1 equals symbol to set RECScreen.Enabled to false.
User avatar
volttide
VIP - Donator
VIP - Donator
Posts: 106
Joined: Mon Jan 17, 2011 8:24 am

Re: mini screen recorder test code
volttide
so, is this work?
User avatar
Bogoh67
VIP - Site Partner
VIP - Site Partner
Posts: 656
Joined: Sun Apr 18, 2010 8:20 pm

Re: mini screen recorder test code
Bogoh67
basically what mandai is saying is that where you said
RECScreen.enabled == false

you have to change it to
RECScreen.Enabled = true;

because when you say == it will get if recscreen.enabled is false
when you put = it will set RECScreen.enabled to false instead of testing whether or not it is false
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Re: mini screen recorder test code
Axel
Bogoh67 wrote:
basically what mandai is saying is that where you said
RECScreen.enabled == false

you have to change it to
RECScreen.Enabled = true;

because when you say == it will get if recscreen.enabled is false
when you put = it will set RECScreen.enabled to false instead of testing whether or not it is false
== comparing
= assigning

or whatever it may be called

same in almost ANY C-based language
http://vagex.com/?ref=25000
User avatar
Agust1337
Coding God
Coding God
Posts: 2456
Joined: Fri Feb 19, 2010 8:18 pm

RECScreen.Enabled == false is wrong
RECScreen.Enabled = false is right.
Top-notch casual Dating
6 posts Page 1 of 1
Return to “General coding help”