Jump to content
Sign in to follow this  
andygo

_GDIPlus_GraphicsDrawLine

Recommended Posts

andygo

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

Share this post


Link to post
Share on other sites
Zedna

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

Edited by Zedna

Share this post


Link to post
Share on other sites
andygo

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

Share this post


Link to post
Share on other sites
andygo

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.

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.