CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Feb 2009
    Posts
    5

    Question 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 ?

  2. #2
    Join Date
    Mar 2008
    Location
    IRAN
    Posts
    811

    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;
            }
    Please rate my post if it was helpful for you.
    Java, C#, C++, PHP, ASP.NET
    SQL Server, MySQL
    DirectX
    MATH
    Touraj Ebrahimi
    [toraj_e] [at] [yahoo] [dot] [com]

  3. #3
    Join Date
    Feb 2009
    Posts
    5

    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..

  4. #4
    Join Date
    Mar 2008
    Location
    IRAN
    Posts
    811

    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.
    Please rate my post if it was helpful for you.
    Java, C#, C++, PHP, ASP.NET
    SQL Server, MySQL
    DirectX
    MATH
    Touraj Ebrahimi
    [toraj_e] [at] [yahoo] [dot] [com]

  5. #5
    Join Date
    Feb 2009
    Posts
    5

    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 ?

  6. #6
    Join Date
    Mar 2008
    Location
    IRAN
    Posts
    811

    Re: Creating an Image Editor Application

    yes, it is possible if you also combine it with AJAX or write an ActiveX for it.
    Please rate my post if it was helpful for you.
    Java, C#, C++, PHP, ASP.NET
    SQL Server, MySQL
    DirectX
    MATH
    Touraj Ebrahimi
    [toraj_e] [at] [yahoo] [dot] [com]

  7. #7
    Join Date
    Feb 2009
    Posts
    5

    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..

  8. #8
    Join Date
    Mar 2008
    Location
    IRAN
    Posts
    811

    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.
    Please rate my post if it was helpful for you.
    Java, C#, C++, PHP, ASP.NET
    SQL Server, MySQL
    DirectX
    MATH
    Touraj Ebrahimi
    [toraj_e] [at] [yahoo] [dot] [com]

  9. #9
    Join Date
    Feb 2009
    Posts
    5

    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.

  10. #10
    Join Date
    Mar 2008
    Location
    IRAN
    Posts
    811

    Re: Creating an Image Editor Application

    your welcome
    Please rate my post if it was helpful for you.
    Java, C#, C++, PHP, ASP.NET
    SQL Server, MySQL
    DirectX
    MATH
    Touraj Ebrahimi
    [toraj_e] [at] [yahoo] [dot] [com]

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured