Creating an Image Editor Application
Hello all,
I want to create an application for Image Editor. I've created a simple Image Editor, like ms.Paint with less features, only can draw rectangle, line, and ellips, erase things, etc, and no canvas (u can draw everywhere on form.
I want to create a new one, which able to do more, like using canvas, there's layers, able to insert image,etc.
There is a lot of questions I wanna ask.
First of all, I found out that C# has Canvas class, how to use it ?
I'm using this code :
private void Editor_Load(object sender, EventArgs e)
{
Canvas myCanvas = new Canvas();
myCanvas.Width = 500;
myCanvas.Height = 200;
myCanvas.VerticalAlignment = System.Windows.VerticalAlignment.Top;
myCanvas.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
}
There is nothing happened. Are there is anyway to create Canvas with tools ? If there isn't, please anyone tell me how to use canvas..
and also, are we able to draw on canvas ?
Re: Creating an Image Editor Application
you can use Bitmap with one of its constructors for (width/ height) as canvas.
cosider this code example:
Code:
private void button3_Click(object sender, EventArgs e)
{
Image img = CreatePicture();
pictureBox1.Image = img;
}
private Image CreatePicture()
{
// Create a new Bitmap object, 50 x 50 pixels in size
Image canvas = new Bitmap(50, 50);
// create an object that will do the drawing operations
Graphics artist = Graphics.FromImage(canvas);
// draw a few shapes on the canvas picture
artist.Clear(Color.Lime);
artist.FillEllipse(Brushes.Red, 3, 30, 30, 30);
artist.DrawBezier(new Pen(Color.Blue, 3), 0, 0, 40, 15, 10, 35, 50, 50);
artist.Dispose();
return canvas;
}
Re: Creating an Image Editor Application
@toraj58 :
Thanks for your reply,man .. I'm working on it right now..I'll ask again if I have questions..thanks..
Re: Creating an Image Editor Application
if you had problem using it let me know so i will give you more detail information and write more sample for you.
Re: Creating an Image Editor Application
Hi toraj58, are there any possible way to create a simple image editor which works on web using ASP.Net ?
Re: Creating an Image Editor Application
yes, it is possible if you also combine it with AJAX or write an ActiveX for it.
Re: Creating an Image Editor Application
are there any example of doing those things?
like creating canvas or draw line using mouse or draw shape..
anything may helps..
Re: Creating an Image Editor Application
yes there are. you can search google.
also there are good books about GDI+ that learn you everything about it.
also there are some articles in codeproject site; go and search there.
also for simple issues like how to draw line, curve, shapes you can search in the MSDN.
for specific problems ask here you could not accomplish something.
Re: Creating an Image Editor Application
Codeproject, sounds great..
I'll check that site..
Thanks for replying me all along man,
for the info..
i'll ask here again to let u know if there's problem.
Re: Creating an Image Editor Application