How can I draw a line with pencil like effect ?

I'd like to draw a line with GDI+ like a line on a paper created with a pencil.
Can anybody point me to an example or an article that explain the technique
Thank you,
Andrea



Answer this question

How can I draw a line with pencil like effect ?

  • sgrussell

    I will try your idea Christian.

    I will break my lines or curves into several segments and for each one I will assign different thickness.

    Your help is really appreciated
    Andrea



  • sharadha

    You're saying that you want the line to be irregular, instead of being solid Or you just want to draw a line

  • Jeke

    Hi Andrea.  I thought this was probably what you were after.  A Pen in GDI+ has a fixed width, I would imagine that perhaps the easiest way to go about this would be to create several pens, of varying width, and using a sample like the one you were pointed to ( which actually is based on a C# sample I wrote on the same site, if you wanted C# code instead ), and modifying it so that as the path is built, the code changes which pen it uses from section to section.  As the sections are created in the mousemove event, I'd imagine most of them would be quite small in length.

    I'm still trying to think of a way that a texture brush would help here, but nothing is coming to mind...

  • Holger Grund

    Glad to help.  I hope it looks OK, I've not actually tried it.


  • Mohit Saini

    Hello Christian,
    I'm looking for a variable thinckness line or curve with a texture like paper and a dark gray color.
    Andrea 

  • How can I draw a line with pencil like effect ?