Search:

Type: Posts; User: jmcilhinney

Search: Search took 0.39 seconds.

  1. Replies
    41
    Views
    60,771

    Re: Very Simple Drawing Program

    Why would that solve the problem when I just told you that it's the cause?

    No. Code doesn't just appear out of thin air. You work out the logic first, then you write code to implement the logic....
  2. Replies
    41
    Views
    60,771

    Re: Very Simple Drawing Program

    Except it's not, because you're changing it to StretchImage in the code you just posted. If the Image is not displayed with its original size or aspect ratio or its origin is not coincident with the...
  3. Replies
    41
    Views
    60,771

    Re: Very Simple Drawing Program

    @user20, my example demonstrates what you need to do. What part do you not understand? Have you actually tested this code in the debugger to see how it works, or are you assuming that it should just...
  4. Replies
    41
    Views
    60,771

    Re: Very Simple Drawing Program

    I just did a quick test and saw a similar result, although I'm not sure why to be honest. I'll have to do a bit of investigation and get back to you on that.
  5. Replies
    41
    Views
    60,771

    Re: Very Simple Drawing Program

    An Image is an Image, regardless of how it's created. You would save an Image created like this the same way as you would any other. Follow the CodeBank link in my signature below and check out my...
  6. Replies
    41
    Views
    60,771

    Re: Very Simple Drawing Program

    The whole purpose of this thread is to illustrate how to do exactly that. In my example I use a blank Image. If you don't want to use a blank Image then don't use a blank Image. Use some other...
  7. Replies
    41
    Views
    60,771

    Re: Very Simple Drawing Program

    Paint isn't a .NET application so it wouldn't use this technique, but if you were to create a Paint-like program (which this is a very simple version of) then yes, you would always invalidate the...
  8. Replies
    41
    Views
    60,771

    Re: Very Simple Drawing Program

    I thought that I would add a bit of explanation to this to explain why things are done the way they are.

    The way GDI+ works, controls get repainted on screen over and over again, sometimes many...
  9. Replies
    41
    Views
    60,771

    Re: Very Simple Drawing Program

    No freehand drawing tools handle fast mouse movements all that well. You can either call DrawEllipse repeatedly and leave gaps between the dots, or else call DrawLine repeatedly and end up with a...
  10. Replies
    41
    Views
    60,771

    Re: Very Simple Drawing Program

    What gets drawn is whatever's in the List, so if you don't want a line drawn any more then you need to remove it from the List.
  11. Replies
    41
    Views
    60,771

    Re: Very Simple Drawing Program

    'End' is a reserved word in VB.NET. Just like in SQL, if you want to use a reserved word as an identifier you have to enclose it in brackets. If you don't then it will be interpreted as a reserved...
  12. Replies
    41
    Views
    60,771

    Re: Very Simple Drawing Program

    As you can see from my code I create a Line object from two Points that are read in on the MouseDown and MouseUp events. Instead of a collection of Line objects you would have a collection of...
  13. Replies
    41
    Views
    60,771

    Re: Very Simple Drawing Program

    If you call the DrawLine method of a Graphics object to draw a line, how would you guess you draw a rectangle?
  14. Replies
    41
    Views
    60,771

    Re: Very Simple Drawing Program

    I've never tried freehand drawing myself but this was the third result returned by a Google search for freehand drawing ".net".
  15. Replies
    41
    Views
    60,771

    Very Simple Drawing Program

    C# version here, courtesy of ForumAccount.

    The following code can be used as the basis for a simple drawing program. It assumes that you have a PictureBox on your form named PictureBox1. The...
Results 1 to 15 of 15



Click Here to Expand Forum to Full Width