本文整理汇总了C#中System.Drawing.Point.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Point.ToString方法的具体用法?C# Point.ToString怎么用?C# Point.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.Point
的用法示例。
在下文中一共展示了Point.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddPoint
public void AddPoint(Point pt)
{
if(this.point_dict.ContainsKey(pt.ToString()))
{
MessageBox.Show("添加坐标失败:\n不能添加已在列表中的坐标!");
return;
}
this.point_dict[pt.ToString()] = pt;
this.lbxScatterPoints.Items.Add(pt.ToString());
}
示例2: CanvasMouseUp
void CanvasMouseUp(object sender, MouseEventArgs e)
{
this.Cursor = Cursors.Default;
e_pt = e.Location;
if ( s_pt != Point.Empty)
MessageBox.Show("From "+s_pt.ToString()+"to "+e_pt.ToString());
}
示例3: InitMap
public void InitMap()
{
Graphics g = pictureBox1.CreateGraphics();
int i = 0;
foreach(Jour J in _list_Jour)
{
foreach(ActJour A in J.ListAct)
{
if (A.Ext)
{
PictureBox PB = new PictureBox();
PB.Size = new System.Drawing.Size(20, 20);
PB.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
Point P = new Point(A.X+700 / 5, (1000 / 5) -A.Y);
PB.Location = P;
PB.Click += new System.EventHandler(this.PB_Click);
PB.Name = i.ToString();
PB.Image = ActImage(A, J);
PB.BackColor= Color.Transparent;
PB.Visible = true;
Lpb.Add(PB);
labelInfo.Text = P.ToString();
ListInfo.Add(InfoAct(A, J));
pictureBox1.Controls.Add(PB);
i++;
}
}
}
}
示例4: MainForm_MouseDown
private void MainForm_MouseDown(object sender, MouseEventArgs e)
{
if (checkBoxAddPoint.Checked)
{
scene.DataPoints.Add(new PointD(e.X, e.Y));
this.Invalidate();
return;
}
mouse_start = e.Location;
this.Text = mouse_start.ToString();
capture = scene.HitTest(e.X, e.Y);
switch (capture)
{
case 1:
point_start = scene.CurrentBezier.Point1;
break;
case 2:
point_start = scene.CurrentBezier.Point2;
break;
case 3:
point_start = scene.CurrentBezier.Point3;
break;
case 4:
point_start = scene.CurrentBezier.Point4;
break;
default:
break;
}
}
示例5: adjustLocation
private static void adjustLocation(XmlNode destNode, Point offset)
{
if (offset.ToString() != "0,0")
{
Point location = getLocationAttribute(destNode);
location.X += offset.X;
location.Y += offset.Y;
setLocationAttribute(destNode, location);
}
}
示例6: GetPiece
/// <summary>
/// Returns the <see cref="Piece"/> object at the specified co-ordinates.
/// </summary>
/// <param name="position">
/// The position of the piece to get.
/// </param>
/// <exception cref="IndexOutOfRangeException">
/// Thrown if the X and Y values in <i>position</i> are invalid.
/// </exception>
/// <returns>
/// The <see cref="Piece"/> object at the requested position.
/// </returns>
public Player GetPiece(Point position)
{
if (position.X < 0 || position.X > (Board.Dimension) ||
position.Y < 0 || position.Y > (Board.Dimension))
{
throw new IndexOutOfRangeException(
"Point " + position.ToString() + " is out of range.");
}
int shiftOut = this.GetShiftOut(position.X, position.Y);
return (Player)((this.pieces >> shiftOut) & 3L);
}
示例7: EndSelect
public void EndSelect(GraphApp app, GraphAppGUI appGUI, Point p, bool shiftHeld)
{
Console.WriteLine("Selection end: " + p.ToString());
Started = false;
endPoint = p;
Rectangle selectionRect = getSelectionRectangle(startPoint, endPoint);
GraphPanel gp = appGUI.CurrentGraphPanel;
if (!shiftHeld)
{
gp.Deselect();
}
List<ISelectable> selectables = gp.Selectables;
int selectTotal = 0;
foreach (ISelectable s in selectables)
{
if (s.Intersects(selectionRect))
{
bool filterPass = false;
foreach (SelectionFilter filter in filters)
{
if (filter.PassesFilter(s.GetItem()))
{
filterPass = true;
}
}
if (!filterPass)
{
continue;
}
gp.Select(s);
s.Select();
selectTotal++;
Console.WriteLine("Selected " + s.ToString());
}
}
if (selectTotal == 0)
{
Console.WriteLine("Selected nothing");
gp.Deselect();
}
gp.Refresh();
}
示例8: EdgeConstructorTest
public void EdgeConstructorTest()
{
//Arrange
Vertex v1 = new Vertex(100, new Point(100, 100));
Vertex v2 = new Vertex(200, new Point(200, 200));
int cost = 500;
Point stringPosition = new Point(300,300);
//Act
Edge target = new Edge(v1, v2, cost, stringPosition);
//Assert
Assert.AreEqual(target.V1.Name, v1.Name);
Assert.AreEqual(target.V2.Name, v2.Name);
Assert.AreEqual(target.Cost, cost);
Assert.AreEqual(target.StringPosition.ToString(), stringPosition.ToString());
}
示例9: courtBox_MouseDown
private void courtBox_MouseDown(object sender, MouseEventArgs e)
{
const int imageBorder = 6;
const float xSize = 1199;
const float ySize = 716;
MouseButtons currButton = e.Button;
Point loc = new Point(e.X, e.Y);
/* We need to get the location of the click in "ESPN" coordinates. That is, the top left corner is (0,0)
* and the bottom right corner is (940, 500). */
loc.X = (int)((loc.X - imageBorder) / xSize * 940);
loc.Y = (int)((loc.Y - imageBorder) / ySize * 500);
Console.WriteLine("Click registered:");
Console.WriteLine("\t" + loc.ToString());
Console.WriteLine("\t" + currButton.ToString());
}
示例10: Main
static void Main(string[] args)
{
int bufSize = 256;
StringBuilder sb = new StringBuilder(bufSize);
Rectangle rect = new Rectangle(0, 0, 100, 100);
if (SetNHW32())
{
{
for (;;)
{
int i = 1;
int j = 0;
Point cursorPoint = new Point();
GetCursorPos(ref cursorPoint);
BL_SetFlag32((uint)GetWordFlag.enable, IntPtr.Zero, cursorPoint.X, cursorPoint.Y);
Thread.Sleep(1000);
BL_GetText32(sb, bufSize, ref rect);
System.Console.WriteLine(sb.ToString() + " " + rect.ToString() + " " + cursorPoint.ToString());
}
}
}
}
示例11: Init
public void Init(Form1 mainForm, CoronaJointure joint)
{
this.MainForm = mainForm;
this.cJoint = joint;
modePanel = "NEW";
if (this.cJoint.type.Equals("WHEEL")) {
this.objA = cJoint.coronaObjA;
obj1Tb.Text = objA.DisplayObject.Name;
this.objB = cJoint.coronaObjB;
obj2Tb.Text = objB.DisplayObject.Name;
this.axisDistance = cJoint.axisDistance;
axisDistanceTb.Text = axisDistance.ToString();
this.setAnchorPoint(cJoint.AnchorPointA);
motorSpeedNup.Value = Convert.ToInt32(cJoint.motorSpeed);
motorForceNup.Value = Convert.ToInt32( cJoint.maxMotorTorque);
modePanel = "MODIFY";
}
}
示例12: PointToScreen
public Point PointToScreen(Point point)
{
if (!Functions.ClientToScreen(window.Handle, ref point))
throw new InvalidOperationException(String.Format(
"Could not convert point {0} from screen to client coordinates. Windows error: {1}",
point.ToString(), Marshal.GetLastWin32Error()));
return point;
}
示例13: tsbtnLocalization_Click
private void tsbtnLocalization_Click(object sender, EventArgs e)
{
if (this.current_fingerprint == null)
return;
FormLocalizationSetting fls = new FormLocalizationSetting();
if (this.current_dbpath != null)
fls.DBpath = this.current_dbpath;
if (fls.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
System.Runtime.Serialization.IFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
FileStream fs = new FileStream(fls.DBpath, FileMode.Open, FileAccess.Read, FileShare.Read);
FingerprintDataBase fdb = (FingerprintDataBase)formatter.Deserialize(fs);
fs.Close();
FingerprintDataBase.Match_Strategy match_strategy = fls.MatchStrategy;
double[] args = fls.Args;
PointF loc = (new FingerprintDataBase(fdb.loc_fingerprint_dict, fdb.map)).MatchLocation(this.current_fingerprint[this.FingerprintName], match_strategy, args);
this.current_dbpath = fls.DBpath;
Point pt_real = new Point();
foreach (Transmitter trans in this.viz_rps.Map.Transmitters)
pt_real = trans.Location;
lbxLocResult.Items.Add("真实\t" + pt_real.ToString());
lbxLocResult.Items.Add("估计\t" + loc.ToString());
double err_pxl = new MathUtils.MathUtility().point_dist(pt_real, loc);
lbxLocResult.Items.Add("误差(p)\t" + err_pxl.ToString("0.00"));
lbxLocResult.Items.Add("误差(m)\t" + (err_pxl * this.viz_rps.Map.MeterPixelRatio).ToString("0.00"));
lbxLocResult.Items.Add("--------------");
lbxLocResult.SelectedIndex = lbxLocResult.Items.Count - 1;
}
}
示例14: imagem_MouseUp
private void imagem_MouseUp(object sender, MouseEventArgs e)
{
if (box)
{
box = false;
p2 = e.Location;
if (p2.X - p1.X < 0) return;
if (p2.Y - p1.Y < 0) return;
if (p1 == p2)
{
Rectangle rtest;
Point pt1, pt2;
int i = 0;
foreach (Box boxp in lista_box)
{
pt1 = boxp.P1;
pt2 = boxp.P2;
rtest = new Rectangle(pt1.X, pt1.Y, pt2.X - pt1.X, pt2.Y - pt1.Y);
if(rtest.Contains(p1))
{
lista.SelectedIndex = i;
}
i++;
}
return;
}
imagem.Invalidate();
lista_box.Add(new Box(p1, p2));
lista.Items.Add(p1.ToString() + " - " + p2.ToString());
lista.SelectedIndex = lista_box.Count - 1;
}
}
示例15: b_adjust_bot_Click
private void b_adjust_bot_Click(object sender, EventArgs e)
{
Point found_point = divideAndConquerSearch(0, 500);
if(found_point == FAIL_POINT)
{
writeToLog(module_name, "Could not adjust Bot!");
return;
}
Point to_match = new Point(607, 585);
Point adjust_point_p = new Point(found_point.X - to_match.X, found_point.Y - to_match.Y);
if (Tools.adjust_bot_point == adjust_point_p)
{
writeToLog(module_name, "Bot was correctly adjusted.");
}
else
{
MyXML xml = new MyXML(config_path);
xml.write(adjust_point_x, adjust_point_p.X.ToString());
xml.write(adjust_point_y, adjust_point_p.Y.ToString());
Tools.adjust_bot_point = adjust_point_p;
writeToLog(module_name, "Bot correctly adjusted from " + Tools.adjust_bot_point.ToString() + " to " + adjust_point_p.ToString() + ".");
}
BackgroundWorker bgw = new BackgroundWorker();
bgw.DoWork += new DoWorkEventHandler(AsyncAdjustPixelColors);
bgw.RunWorkerAsync();
}