For some reason though i'm getting errors on the following code, ignore the last section of the code just concentrate on the errors.
[code]
using System;
using System.Drawing;
namespace rotate
{
class Program
{
static void Main(string[] args)
{
if (args.Length >= 2)
{
string url = args[0];
string rotateAmount = args[1];
string path = "image1.jpg";
//create an image object from the image in that path
System.Drawing.Image img = System.Drawing.Image.FromFile(path);
//Rotate the image in memory
img.RotateFlip(RotateFlipType.Rotate90FlipNone);
//Delete the file so the new image can be saved
System.IO.File.Delete(path);
//save the image out to the file
img.Save(path);
//release image file
img.Dispose();
// Wait for user to acknowledge the results.
Console.WriteLine(url + " " + rotateAmount);
Console.WriteLine("Press any key to quit!");
Console.Read();
}
}
}
}
[code]
Errors:
[code]
Error 1 The type or namespace name 'Image' does not exist in the namespace 'System.Drawing' (are you missing an assembly reference?) c:\users\martyn ball\documents\visual studio 2012\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs 18 32 ConsoleApplication1
Error 2 The type or namespace name 'Image' does not exist in the namespace 'System.Drawing' (are you missing an assembly reference?) c:\users\martyn ball\documents\visual studio 2012\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs 18 59 ConsoleApplication1
Error 3 The name 'RotateFlipType' does not exist in the current context c:\users\martyn ball\documents\visual studio 2012\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs 21 32 ConsoleApplication1
[/code]
Kip HackmanPosted Feb 22, 2021, 6:05 PM
Iftikar HussainPosted Jul 24, 2013, 11:57 PM
You need to Add the reference of System.Drawing
Regards,
Iftikar