public class SetFont(stringname, size, Fonstyle, style);
p_font = new Font(name, size, style, GraphicsUnit.Pixel);
}
public void Print (int x, int y, string text, Brush color)
{
Device .DrawString (text, p_font, color, (float)x, (float)y);
}
public void Print(Point pos, string text, Brush color)
{
Print(pos.X, pos.Y, text, color)
}
public void Print {int x, int y, string text)
{
Print(x, y, text, Brushes.White);
}
public void Print(Point pos, string text)
{
Print(pos.X, pos.Y, text);
}
/*
* Bitmap support functions
* */
public Bitmap LoadBitmap(string filname)
{
Bitmap bmp= null;
try
{
bmp = new Bitmap(filename)
}
catch (Exceptions ex) {}
return bmp;
public void DrawBitmap (ref Bitmap bmp, float x, float y)
{
p_device.DrawImageUnscaled(bmp, (int)x, (int)y);
}
public void DrawBitmap(ref Bitmap bmp, float x, float y, int width, int height)
{
p_device.DrawImageUnscaled(bmp, (int)x, (int)y, width, heigt);
}
public void DrawBitmap(ref Bitmap bmp, Point pos)
{
p_device.DrawImageUnscaled(bmp, pos);
}
public void DrawBitmap(ref Bitmap bmp, Point pos, Size size)
{
p_device.DrawImageUnscaled(bmp, pos.X, pos.Y, size.Width, size.Height);
}
}
}
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
C# Error Help
Page 1 of 12 Replies - 425 Views - Last Post: 17 May 2012 - 04:30 PM
#1
C# Error Help
Posted 17 May 2012 - 07:49 AM
I have been getting an error in my C# code, and I would enjoy some help. The set font line is screwed up, I messed it up whilst trying to fix the rest. The voids are all highlighted and it says 'expected class,delegate, enum, interface, or struct' help is much apprechiated.
Replies To: C# Error Help
#2
Re: C# Error Help
Posted 17 May 2012 - 08:21 AM
Your first line, you don't put a ; at the end of a class declaration, try using a {
Also move line 4 to line 58 of your code (yes, you'll need two }). This might not fix all your issues (as you have your namespace in an odd spot) but it will fix some.
Also move line 4 to line 58 of your code (yes, you'll need two }). This might not fix all your issues (as you have your namespace in an odd spot) but it will fix some.
#3
Re: C# Error Help
Posted 17 May 2012 - 04:30 PM
There are more than 500,000 users on the DIC. Can you imagine if they all started threads as "Problem" ? Please use meaningful titles so the people with the most knowledge in your area are drawn to your question. This also helps people later using search engines to find they help they need.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote





|