Well I have another question come up... and I'll keep whitespace in mind this time. I've started a program.... and well I'm having a bit of trouble with it...
CODE
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace DeadRealm
{
public partial class Form1 : Form
{
int intx;
int inty;
string tester;
public Form1()
{
InitializeComponent();
intx = 0;
inty = 0;
}
public void changeX(int passedx, int modifierx)
{
if (intx != 0)
{
intx = passedx + modifierx;
}
}
public void changeY(int passedy, int modifieryy)
{
if (inty != 0)
{
inty = passedy + modifieryy;
}
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
switch(e.KeyCode.ToString())
{
case "Up":
changeY(inty, -1);
break;
case "Down":
changeY(inty, 1);
break;
case "Left":
changeX(intx, -1);
break;
case "Right":
changeX(intx, 1);
break;
default:
break;
}
}
private void Form1_KeyPress(object sender, KeyPressEventArgs e)
{
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
//Create Image
Image newImage = Image.FromFile("C:\\Documents and Settings\\Davids\\Desktop\\DeadRealm\\testmap.bmp");
//Create rectangle for drawing image
Rectangle destRect = new Rectangle(0, 0, 400, 400);
//Create rectangel for source image.
Rectangle srcRect = new Rectangle(intx, inty, 400, 400);
GraphicsUnit units = GraphicsUnit.Pixel;
//Draw image to screen
e.Graphics.DrawImage(newImage, destRect, srcRect, units);
}
}
}
this is in C# keep in mind but if you give the answer in C++ I'm sure I'll be fine
Anyways. what I want it to do is every time I press and arrow key it re-draws the bitmap on the screen starting from a different origin... if you look
CODE
private void Form1_Paint(object sender, PaintEventArgs e)
{
//Create Image
Image newImage = Image.FromFile("C:\\Documents and Settings\\Davids\\Desktop\\DeadRealm\\testmap.bmp");
//Create rectangle for drawing image
Rectangle destRect = new Rectangle(0, 0, 400, 400);
//Create rectangel for source image.
Rectangle srcRect = new Rectangle(intx, inty, 400, 400);
GraphicsUnit units = GraphicsUnit.Pixel;
//Draw image to screen
e.Graphics.DrawImage(newImage, destRect, srcRect, units);
}

^ draws it the first time... and it works... its just not handling anything else right... suggestions?