Disregard that last post. I see what it does now. Thanks again.
"ML" <ml@schoonersolutions.com> wrote in message
news:Oc4cBHkQDHA.2852@tk2msftngp13.phx.gbl...
> Thank you very much. It seems to plot some points outside the box but I
> think I get the point.
>
> "Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
> news:%23YJ%23T8jQDHA.304@tk2msftngp13.phx.gbl...
> > See the sample application below my signature. It paints lat-longs in a
> > bounded box. To refresh the screen , click the form.
> >
> > --
> > Bob Powell [MVP]
> > C#, System.Drawing
> >
> > Check out the GDI+ FAQ
> >
http://www.bobpowell.net/gdiplus_faq.htm > >
> > Buy quality Windows Forms tools
> >
http://www.bobpowell.net/xray_tools.htm > >
> > Get the NEW must-have UI component. The .NET RectTracker
> > Enables CRectTracker like functionality for WindowsForms.
> > User defined layouts are a breeze.
> >
http://www.bobpowell.net/recttracker.htm > >
> > -------------------------------------------------------------------
> > using System;
> >
> > using System.Drawing;
> >
> > using System.Collections;
> >
> > using System.ComponentModel;
> >
> > using System.Windows.Forms;
> >
> > using System.Data;
> >
> >
> >
> > namespace latlong
> >
> > {
> >
> > /// <summary>
> >
> > /// Summary description for Form1.
> >
> > /// </summary>
> >
> > public class Form1 : System.Windows.Forms.Form
> >
> > {
> >
> > /// <summary>
> >
> > /// Required designer variable.
> >
> > /// </summary>
> >
> > private System.ComponentModel.Container components = null;
> >
> >
> >
> > struct LatLong
> >
> > {
> >
> > public float Degrees;
> >
> > public float Minutes;
> >
> > public float Seconds;
> >
> > }
> >
> >
> >
> > public Form1()
> >
> > {
> >
> > //
> >
> > // Required for Windows Form Designer support
> >
> > //
> >
> > InitializeComponent();
> >
> >
> >
> > //
> >
> > // TODO: Add any constructor code after InitializeComponent call
> >
> > //
> >
> > }
> >
> >
> >
> > /// <summary>
> >
> > /// Clean up any resources being used.
> >
> > /// </summary>
> >
> > protected override void Dispose( bool disposing )
> >
> > {
> >
> > if( disposing )
> >
> > {
> >
> > if (components != null)
> >
> > {
> >
> > components.Dispose();
> >
> > }
> >
> > }
> >
> > base.Dispose( disposing );
> >
> > }
> >
> >
> >
> > #region Windows Form Designer generated code
> >
> > /// <summary>
> >
> > /// Required method for Designer support - do not modify
> >
> > /// the contents of this method with the code editor.
> >
> > /// </summary>
> >
> > private void InitializeComponent()
> >
> > {
> >
> > //
> >
> > // Form1
> >
> > //
> >
> > this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
> >
> > this.ClientSize = new System.Drawing.Size(384, 325);
> >
> > this.Name = "Form1";
> >
> > this.Text = "Form1";
> >
> > this.Click += new System.EventHandler(this.Form1_Click);
> >
> > this.Paint += new
> > System.Windows.Forms.PaintEventHandler(this.Form1_Paint);
> >
> >
> >
> > }
> >
> > #endregion
> >
> >
> >
> > /// <summary>
> >
> > /// The main entry point for the application.
> >
> > /// </summary>
> >
> > [STAThread]
> >
> > static void Main()
> >
> > {
> >
> > Application.Run(new Form1());
> >
> > }
> >
> >
> >
> > private void Form1_Paint(object sender,
> > System.Windows.Forms.PaintEventArgs e)
> >
> > {
> >
> > Random r = new Random();
> >
> > LatLong[] latlongs = new LatLong[10];
> >
> > for(int i=0; i<10; i++)
> >
> > {
> >
> > latlongs[i].Degrees=r.Next(360);
> >
> > latlongs[i].Minutes=r.Next(60);
> >
> > latlongs[i].Seconds=r.Next(60);
> >
> > }
> >
> >
> >
> > RectangleF bounds = new RectangleF(30,30,300,300);
> >
> >
> >
> >
> >
>
e.Graphics.DrawRectangle(Pens.Green,bounds.X,bounds.Y,bounds.Width,bounds.He
> > ight);
> >
> >
> >
> > for(int i=0; i<10; i+=2)
> >
> > {
> >
> > PointF p = new PointF(
> >
> > (float)(latlongs[i].Degrees+
> >
> > (latlongs[i].Minutes/60)+
> >
> > (latlongs[i].Seconds/3600)),
> >
> > (float)(latlongs[i+1].Degrees+
> >
> > (latlongs[i+1].Minutes/60)+
> >
> > (latlongs[i+1].Seconds/3600)));
> >
> >
> >
> > if(bounds.Contains(p))
> >
> > e.Graphics.DrawEllipse(Pens.Black,p.X-2,p.Y-2,4,4);
> >
> > else
> >
> > e.Graphics.DrawEllipse(Pens.Red,p.X-2,p.Y-2,4,4);
> >
> >
> >
> >
> >
> > }
> >
> >
> >
> >
> >
> >
> >
> > }
> >
> >
> >
> > private void Form1_Click(object sender, System.EventArgs e)
> >
> > {
> >
> > this.Invalidate();
> >
> > }
> >
> > }
> >
> > }
> >
> >
> >
> > -------------------------------------------------------------------
> >
> > "ML" <ml@schoonersolutions.com> wrote in message
> > news:ulMoJkjQDHA.2476@TK2MSFTNGP10.phx.gbl...
> > > Do you have any samples of doing this?
> > >
> > > "Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
> > > news:OsmfcGjQDHA.2316@TK2MSFTNGP12.phx.gbl...
> > > >
> > > > Just convert the minutes and seconds into fractional degrees and
plot
> > > using
> > > > the floating point representation.
> > > >
> > > > By using a RectangleF as the bounds, you can determine whether to
plot
> > by
> > > > seeing if the rectangle contains the point.
> > > >
> > > > --
> > > > Bob Powell [MVP]
> > > > C#, System.Drawing
> > > >
> > > > Check out the GDI+ FAQ
> > > >
http://www.bobpowell.net/gdiplus_faq.htm > > > >
> > > > Buy quality Windows Forms tools
> > > >
http://www.bobpowell.net/xray_tools.htm > > > >
> > > > Get the NEW must-have UI component. The .NET RectTracker
> > > > Enables CRectTracker like functionality for WindowsForms.
> > > > User defined layouts are a breeze.
> > > >
http://www.bobpowell.net/recttracker.htm > > > >
> > > > "ML" <ml@schoonersolutions.com> wrote in message
> > > > news:Ou7suYiQDHA.3144@tk2msftngp13.phx.gbl...
> > > > > Does anyone know of a control or have sample code that would allow
> the
> > > > > plotting of points based on lat long within a given area?
> > > > > Just looking for something simple to plot a number of points
within
> a
> > > > > bounding area.
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>