c# - How to check drawn line doesn't go outside of form area? -


i found shape drawing article this link. trying add check drawn line doesn't go outside of form area.

appreciate guidance in resolving this.

you can use contains method of rectangle. try this:

bool islinecutoff = !(yourform.clientrectangle.contains(p1) &&                       yourform.clientrectangle.contains(p2)); //p1 , p2 2 endpoints of line. 

Comments

Popular posts from this blog

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -