AnnotationLineColor Example VB

This example draws a green line across the width of an image.

Private Sub cmdDrawLine_Click()
    Dim XWidth As OLE_XSIZE_PIXELS
     
    'Determine the width of the image -- this will
    'work even if the image is scaled up or down
    XWidth = ImgEdit1.ImageScaleWidth
    
    'line will be green, transparent, 10 pixels wide
    ImgEdit1.AnnotationLineColor = vbGreen
    ImgEdit1.AnnotationLineStyle = wiTransparent  '0
    ImgEdit1.AnnotationLineWidth = 10
    ImgEdit1.AnnotationType = wiStraightLine  '1
    
    'Draw the line
    'left position = 0 (start at left side)
    'top position = 100 pixels from top of page
    'width of line = width of image as it is displayed
    'height of line = 0 (line will be horizontal)
    ImgEdit1.Draw 0, 100, XWidth, 0
End Sub