Click here to Skip to main content
15,890,377 members
Home / Discussions / C#
   

C#

 
GeneralRe: Programmatically login to website that uses 2 steps. Pin
Dralken10-Feb-16 4:30
Dralken10-Feb-16 4:30 
GeneralRe: Programmatically login to website that uses 2 steps. Pin
Luc Pattyn11-Feb-16 0:29
sitebuilderLuc Pattyn11-Feb-16 0:29 
GeneralRe: Programmatically login to website that uses 2 steps. Pin
OriginalGriff11-Feb-16 0:35
mveOriginalGriff11-Feb-16 0:35 
SuggestionRe: Programmatically login to website that uses 2 steps. Pin
Richard Deeming10-Feb-16 4:16
mveRichard Deeming10-Feb-16 4:16 
AnswerRe: Programmatically login to website that uses 2 steps. Pin
V.10-Feb-16 20:21
professionalV.10-Feb-16 20:21 
QuestionIssue with Serial Port class Pin
Member 120616009-Feb-16 23:13
Member 120616009-Feb-16 23:13 
SuggestionRe: Issue with Serial Port class Pin
Richard MacCutchan10-Feb-16 0:14
mveRichard MacCutchan10-Feb-16 0:14 
GeneralRe: Issue with Serial Port class Pin
Member 1206160010-Feb-16 0:23
Member 1206160010-Feb-16 0:23 
GeneralRe: Issue with Serial Port class Pin
Richard MacCutchan10-Feb-16 0:30
mveRichard MacCutchan10-Feb-16 0:30 
GeneralRe: Issue with Serial Port class Pin
Member 1206160010-Feb-16 0:38
Member 1206160010-Feb-16 0:38 
GeneralRe: Issue with Serial Port class Pin
Richard MacCutchan10-Feb-16 1:02
mveRichard MacCutchan10-Feb-16 1:02 
GeneralRe: Issue with Serial Port class Pin
Member 1206160010-Feb-16 1:18
Member 1206160010-Feb-16 1:18 
GeneralRe: Issue with Serial Port class Pin
Richard MacCutchan10-Feb-16 1:30
mveRichard MacCutchan10-Feb-16 1:30 
GeneralRe: Issue with Serial Port class Pin
Member 1206160010-Feb-16 1:52
Member 1206160010-Feb-16 1:52 
GeneralRe: Issue with Serial Port class Pin
Eddy Vluggen10-Feb-16 3:00
professionalEddy Vluggen10-Feb-16 3:00 
AnswerRe: Issue with Serial Port class Pin
Gerry Schmitz10-Feb-16 5:39
mveGerry Schmitz10-Feb-16 5:39 
QuestionWeb Services - Error in deserializing body of request message for operation Pin
FabeCode9-Feb-16 18:54
FabeCode9-Feb-16 18:54 
AnswerRe: Web Services - Error in deserializing body of request message for operation Pin
Gerry Schmitz10-Feb-16 5:13
mveGerry Schmitz10-Feb-16 5:13 
Question'ctor design and extra "cost" of using nullable ValueTypes ? Pin
BillWoodruff9-Feb-16 0:31
professionalBillWoodruff9-Feb-16 0:31 
AnswerRe: 'ctor design and extra "cost" of using nullable ValueTypes ? Pin
Pete O'Hanlon9-Feb-16 1:02
mvePete O'Hanlon9-Feb-16 1:02 
GeneralRe: 'ctor design and extra "cost" of using nullable ValueTypes ? Pin
BillWoodruff9-Feb-16 20:08
professionalBillWoodruff9-Feb-16 20:08 
GeneralRe: 'ctor design and extra "cost" of using nullable ValueTypes ? Pin
Pete O'Hanlon9-Feb-16 21:30
mvePete O'Hanlon9-Feb-16 21:30 
SuggestionRe: 'ctor design and extra "cost" of using nullable ValueTypes ? Pin
Richard Deeming9-Feb-16 1:51
mveRichard Deeming9-Feb-16 1:51 
GeneralRe: 'ctor design and extra "cost" of using nullable ValueTypes ? Pin
BillWoodruff9-Feb-16 20:09
professionalBillWoodruff9-Feb-16 20:09 
QuestionLarge terrain problem in main first game Pin
Member 122480289-Feb-16 0:25
Member 122480289-Feb-16 0:25 
I am try main first game, and have problem with terrain creatin. When i am load and use large texture is ok, when i am moving in game crash program with this message:

System.OutOfMemoryException: Out of memory.

at System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement)
at System.Drawing.Image.FromFile(String filename)
at sls.go.GoPaint(Object sender, PaintEventArgs e) in c:\Users\Jozef\Documenty\SharpDevelop Projects\sls\sls\go.cs:line 93
at System.Windows.Forms.Control.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Form.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Here is source code:

C#
/*
   Game Rise of The Synaptic 1/3
   Copyright (C) 2016 Jozef Bakoš
   Tento program je slobodný softvér: môžete ho šíriť a upravovať podľa ustanovení Všeobecnej verejnej licencie GNU 
   (GNU General Public Licence), vydávanej nadáciou Free Software Foundation a to buď podľa 3. verzie tejto Licencie, 
   alebo (podľa vášho uváženia) ktorejkoľvek neskoršej verzie. Tento program je rozširovaný v nádeji, že bude užitočný,
   avšak BEZ AKEJKOĽVEK ZÁRUKY. Neposkytujú sa ani odvodené záruky PREDAJNOSTI alebo VHODNOSTI PRE URČITÝ ÚČEL. 
   Ďalšie podrobnosti hľadajte vo Všeobecnej verejne licencii GNU.

   Kópiu Všeobecnej verejnej licencie GNU ste mali dostať spolu s týmto programom. 
   Ak sa tak nestalo, nájdete ju tu: <http://www.gnu.org/licenses/>. .
 */
 
using System;
using System.Drawing;
using System.Windows.Forms;
using PlaySound;
using System.Drawing.Drawing2D;

namespace sls
{

	/// <summary>
	/// Description of go.
	/// </summary>
	public partial class go : Form
	{
		public go()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			
			//
			// TODO: Add constructor code after the InitializeComponent() call.
			//
		}
		int RotatePlayerinfo = 0;
		int TempMatrixX = 0;
		int TempMatrixY = 0;
		bool left;
		bool right;
		bool up;
		bool down;
		
		
		void GoLoad(object sender, EventArgs e)
		{
			// Default setings
			this.Cursor = Cursors.Cross;
     		this.ControlBox = false;
			//this.FormBorderStyle = FormBorderStyle.None;
            this.WindowState = FormWindowState.Maximized;
            this.DoubleBuffered = true;
			
            // Timer setings
            Refresh.Interval = 50;
			Refresh.Enabled = true;
			PlayerInfo.Interval = 500;
            PlayerInfo.Enabled = true;
            PlayerMoving.Interval = 50;
            PlayerMoving.Enabled = true;
            
           
            
			// Picturebox setings
			//playerBox.BackColor = Color.Transparent;
			
			// Event setings
			this.Paint += new PaintEventHandler(GoPaint);
			
 		}
		
		void GoKeyDown(object sender, KeyEventArgs e)
		{
			if ( e.KeyCode == Keys.Left ) { left = true; }
			if ( e.KeyCode == Keys.Right) { right = true; }
			if ( e.KeyCode == Keys.Up ) { up = true; }
			if ( e.KeyCode == Keys.Down ) { down = true; }
		}
		
		void GoKeyUp(object sender, KeyEventArgs e)
		{
			if ( e.KeyCode == Keys.Left ) { left = false; }
			if ( e.KeyCode == Keys.Right) { right = false; }
			if ( e.KeyCode == Keys.Up ) { up = false; }
			if ( e.KeyCode == Keys.Down ) { down = false; }
		}
		
		void GoPaint(object sender, PaintEventArgs e)
		{
			 Image terrain = Image.FromFile(@"object\terrain.bmp");
			 e.Graphics.DrawImage(terrain, TempMatrixX, TempMatrixY);
			 
			 Image player = Image.FromFile(@"object\player1.png");
			 e.Graphics.DrawImage(player , 0, this.Height - 130, 100 , 100);
    	}
		
		void RefreshTick(object sender, EventArgs e)
		{
			this.Refresh();
		}
		
		void PlayerInfoTick(object sender, EventArgs e)
		{
			// Rotate player
			RotatePlayerinfo++;
		}
		
		void PlayerMovingTick(object sender, EventArgs e)
		{
	     	// Debug information
			this.Text="Terrain X:"+TempMatrixX+" Terrain Y:"+TempMatrixY;
			
			if ( TempMatrixX > -1 ) { TempMatrixX = -1; }
			if ( TempMatrixY > -1 ) { TempMatrixY = -1; }
			
			// Move verticaly terrainBox
			if ( up == true ) { TempMatrixY++;  }
			if ( down == true ) { TempMatrixY--; }
				
			// Move horizontaly terrainBox
			if ( left == true ) { TempMatrixX--; } 
		if ( right == true ) { TempMatrixX++;}
			
		
		}
		
	}
}




Can you please help fix this bug. Thx

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.