473,804 Members | 3,182 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Finding A Point On The Form

Hey,
I use the form's graphics object to draw points at random places on the
form.
After drawing the points, how can I know if a certain point on the form
is colored?
Thanks ahead

--sternr

Jul 26 '06 #1
8 1478
sternr wrote:
Hey,
I use the form's graphics object to draw points at random places on the
form.
After drawing the points, how can I know if a certain point on the form
is colored?
... save the places (i.e. the x/y coordinates) that you have colored in a
list. If you keep the list sorted you can even use BinarySearch to
quickly find out if a certain coordinate is contained within the list.

hth,
Max
Jul 26 '06 #2
HI,

You can either save your points and check in this list or using the same
mechanism that you use to drawn you can query the points you just draw

Hint, you should definitely keep track of your points, if your form need
refresh you will have to re-draw them again.

--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"sternr" <St****@gmail.c omwrote in message
news:11******** **************@ m79g2000cwm.goo glegroups.com.. .
Hey,
I use the form's graphics object to draw points at random places on the
form.
After drawing the points, how can I know if a certain point on the form
is colored?
Thanks ahead

--sternr

Jul 26 '06 #3
Thanks for your replies!
The problem is, I draw lines and ellipses,
How can I know if a certain point is in one of them?
If I could get the point's color I could know to which line/polygon it
belongs...
Isnt there a way of doing it?

Thanks again!

--sternr

Jul 27 '06 #4
Hi,
How do you keep track of what you have drawn?
If the form is minimized and later restore you will have to redraw
everything.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"sternr" <St****@gmail.c omwrote in message
news:11******** **************@ m79g2000cwm.goo glegroups.com.. .
Thanks for your replies!
The problem is, I draw lines and ellipses,
How can I know if a certain point is in one of them?
If I could get the point's color I could know to which line/polygon it
belongs...
Isnt there a way of doing it?

Thanks again!

--sternr

Jul 27 '06 #5
sternr wrote:
The problem is, I draw lines and ellipses,
How can I know if a certain point is in one of them?
http://mathforum.org/library/drmath/view/63045.html

Eq.
Jul 27 '06 #6
Paul - thanks for the link - I'll use it!
But isn't there a way of recieving the actual point?

Ignacio - You'r right I'll have to take care of it, but is'nt there a
simpler way of doing it?
I mean it looks like I'm doing something wrong here...
Thanks again,

--sternr

Jul 28 '06 #7
sternr wrote:
Paul - thanks for the link - I'll use it!
But isn't there a way of recieving the actual point?

Ignacio - You'r right I'll have to take care of it, but is'nt there a
simpler way of doing it?
I mean it looks like I'm doing something wrong here...
You can use the Region class if you do not want to implement all the
math yourself. Using the Region class you can define (and draw/paint)
complex shapes. It also provides methods for figuring out if a certain
point is contained within a region. Have a look at:
bool Region.IsVisibl e(Point)
I think that should do what you want!

hth,
Max
Jul 28 '06 #8
Thanks it looks like exactly what I was looking for!

--sternr

Jul 30 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5228
by: Sudhakar Doddi | last post by:
Greetings, I am a novice in Javascript and I am not able to succeed finding right regular expression for my requirement. Input in HTML form should be in the format of row.rack.bin i.e three separate words separated by two dots/periods. User can enter "xyz.." also. Minimum two dots/periods must be present. Here is my code, it works partially. Please point me to the right expression. <script>
8
2064
by: Mr. B | last post by:
I'm writing an app where I'm trying to look for and List all specific file 'types' found. So I point to a specific start top level Folder... and I want to drill down through ALL sub folders to find file types (using File Extenion). All found DWG files are listed in "lbDwgList" Listbox. I can get the top level and the 'immediate' level below the top level... but I can't figure out how to keep going down X levels (ie: All sub-levels). ...
12
5421
by: Mike Smith | last post by:
Hey anyone knows how to find an item in a list view based on text ? Cant seem to get the IndexOf method working. would the LVM_FINDITEM method using SendMessage API work in .Net ?
5
6786
by: Brian Henry | last post by:
Say I put an item into a panel and place it onto a form, and I want to know where on the form the item is in X,Y positions... but If I check the location property of the item in the panel, that is relative to the X,Y cordinates (0,0) of the panel, not of the form. How would I know where the item is on the entire form even though it is in a panel? Like if the panel is 10 from left and 10 from top of the form, and I place a textbox in the...
9
12574
by: dave m | last post by:
I need to be able to retrieve a unique ID from a users PC. I needs to be something a user could not easily change, like the computer name. Could someone point me in the right direction to find the information found in Windows system information? Or maybe there is a better method. Thanks in advance for any help or suggestions. Dave M.
2
2855
by: ElkGroveR | last post by:
Hi there! I'm using PHP to create a simple, dynamic MySQL SELECT query. The user chooses a selection from a HTML Form SELECT element's many options and submits the form via a POST action. The SELECT query is built as follows: $itemtype = stripslashes(trim($_POST));
1
2336
by: Mike Heywood | last post by:
Hi, I am currently trying to automate a process that I have been studying the manual results from for a while. The process simply identifies events that meet certain criteria and at the moment it then requires human interaction to decide what to do next (is a seperate process run or not). I have set up the process to do this automatically based on a couple of variables calculated but I am having a few problems optimising the data to...
1
1405
by: hrubesh | last post by:
Hi, I am having a problem finding the right location of a control if it is found on a form that is on an MDI parent. On mouse click, i want to bring out a "pop up window" that will display extra information and options., but the form itself is being displayed in odd locations i wonder why i have iterated up until the MDI. anyone can help please? Thanks. public partial class Form1 : Form { Point loc;
7
1459
by: squrel | last post by:
Hello everybody.. I have a form to find the records according to contact name and pono... in tht i have a find button tht by clicking has to point to my main grid (frmpo) and show the pono which has been selected in the find form or contact name.. it has to point to the first finding option in tht grid.. i dont knw how to use pointer from this frmfind form to the frmpo and find the selected pono and contactname plz help... thank u
0
9577
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10315
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9140
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.