Drawing on image control

Discussion in 'Basic4ppc Wishlist' started by derez, Jan 15, 2008.

  1. derez

    derez Expert Licensed User

    All the drawing commands like circle, line are limited to drawing on forms.
    It will be useful to have them work on controls.
    Last edited: Jan 15, 2008
  2. Erel

    Erel Administrator Staff Member Licensed User

    You could draw on image controls (and ImageButtons) with the ImageLib library.
    Draw on a bitmap and set the bitmap to be the control's image.
  3. dennishea

    dennishea Active Member Licensed User

    :) Erel, I know I understand what your saying but I'm not sure I understand how to implement it. Could you post a tiny example. Thanks in advance for your help.

  4. Erel

    Erel Administrator Staff Member Licensed User

    Example is attached.

    Attached Files:

  5. dennishea

    dennishea Active Member Licensed User

    Many Thanks Erel

    :) :sign0188: :)
  6. derez

    derez Expert Licensed User

    drawing on control

    I do it with the use of dzimage.dll :
    I draw on another form and then copy the part I need to the image control.
    I just thought it can save some time and code.


    compass.Image = img.CopyImage(form6.Image,3,25,25,25)
  7. klaus

    klaus Expert Licensed User

    Hello Erel,
    could the polygon function and the circle function, which exists for forms, also be added to the Drawer object so we have all the drawing functions in one object ?
    Otherwise if I want to draw a filled ellipse I have to use the Drawer function and if I want to add a filled polygon I must do it on the form and then combine both images.

    Best regards
  8. Erel

    Erel Administrator Staff Member Licensed User

    FillEllipse / DrawEllipse are suitable for circles too (when the rectangle is also a square).
    Polygon will be added to the drawer functionality.
  9. klaus

    klaus Expert Licensed User

    Thank's Erel
    I know that the circle is a particular case of an ellipse.
    But from the drawing point of view:
    - the circle is defined by it's center coordinates and the radius
    - the ellipse is defined by it's outer rectangle
    So why not include both ?

    Best regards
  10. Erel

    Erel Administrator Staff Member Licensed User

    I see your point and will consider it.

    Generally speaking in order to keep the language simple I prefer not to overload it with almost duplicated functions.
    You can also achieve it with:
    Sub DrawCircle(drawerObject,x,y,r,color,fill)
    If fill Then
            brush.Color = color
            pen.Color = color
    End If
    End Sub

    Calling this 
    DrawCircle (
  11. klaus

    klaus Expert Licensed User

    Hello Erel
    I understand your point of view not to overload the laguage with duplicate functions. But on the other hand it's not that convenient to have several fuctions on different places and then need to play with bitmaps or other objects to put everything together. I have some trouble with this.

    Best regards
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice