Jump to content

_GDIPlus_GraphicsDrawLine


Recommended Posts

Hello,

i have a gui with a small picture-control and some other buttons.

please have a look:

Posted Image

how can i tell the _GDIPlus_GraphicsDrawLine function to draw just on the

picture area, NOT over it, NOT over my other buttons?

thanks, andy

p.s.: maybe a dumb question but it's my first time with _GDIPlus_GraphicsDrawLine

Link to comment
Share on other sites

Post your code.

I think some kind of clipping (clipping API functions) could be used here.

In case of drawing by hand it can be done by simpler way: just test mouse position relative to image position/size

hello,

this is the mainpart of drawing-code:

while _IsPressed(01)
    $aOldPos = MouseGetPos()
    sleep(50)
    $aPos = MouseGetPos()
    _GDIPlus_GraphicsDrawLine($hGraphic, $aOldPos[0], $aOldPos[1], $aPos[0], $aPos[1], $hPen)
wend
Link to comment
Share on other sites

edit: ok i created a little tricky solution:

before the while-loop i create a dummy-button.

it's dimensions are big enough to overlay all previous buttons.

if i now draw outside the picturecontrol, i only draw on the dummy-button.

after the while-loop i delete this dummy-button.

and tadaaa: i have clean main buttons.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...