Results 1 to 3 of 3

Thread: How can you draw a line on an Image (not Picturebox)

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    3

    Angry

    I have tried to draw a simple line on an Image (rather than a picturebox) due to the image being capable of stretching while the picturebox is not.

    For example I tried:

    hPen = CreatePen(0, 1, RGB(255, 0, 0))
    SelectObject Image1.Picture.Handle, hPen
    Ellipse Image1.Picture.Handle, 5, 5, 30, 30

    Image1.Refresh

    to draw a simple ellipse on the image. Nothing appears. Is there any way to draw directly to an Image?



  2. #2
    Guest
    ImageBoxes are just for decorations. They hardly do anything.

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Use a picturebox, and look at the documentation for StretchBlt, which allows you to draw the image to a memory space, then do a "stretching block transfer" to the picturebox's hDC (device context).

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