Results 1 to 3 of 3

Thread: PictureBox questions

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Location
    Argentina
    Posts
    5

    Question PictureBox questions

    How can I save an image as a result of a PictureBox.CreateGraphics.DrawLine method ?

    sorry, I don't write English very well .

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    umm you mean you want to create a bitmap and draw a line in it, and then save it to a file?
    if so you could do something like this:
    VB Code:
    1. Dim bmp As New Bitmap(100, 100) ' Create a 100x100 bitmap
    2.         Dim gr As Graphics = Graphics.FromImage(bmp)
    3.         gr.Clear(Color.White) ' make the background white
    4.         gr.DrawLine(Pens.Red, 0, 0, 100, 100)
    5.         bmp.Save("c:\myBmp.bmp")
    6.  
    7.         gr.Dispose()
    8.         bmp.Dispose()
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Location
    Argentina
    Posts
    5

    Thumbs up

    Thanks you very much.

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