本文整理汇总了C#中System.Drawing.PointF类的典型用法代码示例。如果您正苦于以下问题:C# System.Drawing.PointF类的具体用法?C# System.Drawing.PointF怎么用?C# System.Drawing.PointF使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
System.Drawing.PointF类属于命名空间,在下文中一共展示了System.Drawing.PointF类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetRelativePosition
public System.Drawing.PointF GetRelativePosition(Control c) {
System.Drawing.Point relPoint;
System.Drawing.PointF relPointF;
relPoint = c.PointToClient(new System.Drawing.Point((int)ScreenX,(int)ScreenY));
relPointF = new System.Drawing.PointF(relPoint.X + ScreenX - (float)((int)ScreenX),
relPoint.Y + ScreenY - (float)((int)ScreenY));
return relPointF;
}
示例2: PointF
public PointF(float x, float y)
{
InternalVector2 = new Vector2(x, y);
InternalPointF = new System.Drawing.PointF(x, y);
X = x;
Y = y;
}
示例3: VirtualProjector
public VirtualProjector(string name, string uuid, Size imageSize, PointF principal, double focalLength, Screen screen, Chessboard chessboard, CaptureCamera captureCamera)
: base(name, uuid, imageSize, principal, focalLength, screen, chessboard, captureCamera)
{
OrbitCamera = new OrbitCamera("{0} Orbit".FormatWith(name), "N/A", imageSize, principal, focalLength,
Intrinsics.NearPlaneDistance, Intrinsics.FarPlaneDistance) { Color = Color.DarkCyan.Alpha(0.7f), };
Color = Color.DarkKhaki.Alpha(0.6f);
ProgramTask.AttachInputToCamera(Program.WhenInput.Where(input => !input.KeyPressed(Keys.C)), Window, OrbitCamera);
Program.WhenInput.Where(input => input.KeyDown(Keys.P)).Subscribe(input =>
{
var frustum = new Frustum(OrbitCamera, Intrinsics.ImageSize);
var plane = new Plane(Vector3.UnitZ, 0);
var p0 = frustum.IntersectWithPlane(ProjectorQuadCorners[0].X, ProjectorQuadCorners[0].Y, plane).ToPointF();
var p1 = frustum.IntersectWithPlane(ProjectorQuadCorners[1].X, ProjectorQuadCorners[1].Y, plane).ToPointF();
var p2 = frustum.IntersectWithPlane(ProjectorQuadCorners[2].X, ProjectorQuadCorners[2].Y, plane).ToPointF();
var p3 = frustum.IntersectWithPlane(ProjectorQuadCorners[3].X, ProjectorQuadCorners[3].Y, plane).ToPointF();
var quadCorners = new[] { p0, p1, p2, p3, };
// Chessboard.HomographTo(quadCorners);
});
}
示例4: ComputeDepthFrameToCameraSpaceTable
public System.Drawing.PointF[] ComputeDepthFrameToCameraSpaceTable(int tableWidth = depthImageWidth, int tableHeight = depthImageHeight)
{
float fx = (float)depthCameraMatrix[0, 0];
float fy = (float)depthCameraMatrix[1, 1];
float cx = (float)depthCameraMatrix[0, 2];
float cy = (float)depthCameraMatrix[1, 2];
float[] kappa = new float[] { (float)depthLensDistortion[0], (float)depthLensDistortion[1] };
var table = new System.Drawing.PointF[tableWidth * tableHeight];
for (int y = 0; y < tableHeight; y++)
for (int x = 0; x < tableWidth; x++)
{
double xout, yout;
double framex = (double)x / (double)tableWidth * depthImageWidth; // in depth camera image coordinates
double framey = (double)y / (double)tableHeight * depthImageHeight;
CameraMath.Undistort(fx, fy, cx, cy, kappa, framex, (depthImageHeight - framey), out xout, out yout);
var point = new System.Drawing.PointF();
point.X = (float)xout;
point.Y = (float)yout;
table[tableWidth * y + x] = point;
}
return table;
}
示例5: RenderArrow
/// <summary>
/// Method to render the arrow
/// </summary>
/// <param name="map">The map</param>
/// <param name="graphics">The graphics object</param>
/// <param name="arrow">The arrow</param>
private void RenderArrow(SharpMap.Map map, System.Drawing.Graphics graphics, GeoAPI.Geometries.ILineString arrow)
{
var pts = new System.Drawing.PointF[arrow.Coordinates.Length];
for (var i = 0; i < pts.Length; i++)
pts[i] = map.WorldToImage(arrow.GetCoordinateN(i));
graphics.DrawLines(ArrowPen, pts);
}
示例6: Draw
public override void Draw(System.Drawing.Graphics g)
{
System.Drawing.SolidBrush solidBrush = new System.Drawing.SolidBrush(Color);
System.Drawing.PointF upperLeftPoint = new System.Drawing.PointF((float)(Center.X - Width / 2), (float)(Center.Y - Height / 2));
System.Drawing.SizeF rectSize = new System.Drawing.SizeF((float)Width, (float)Height);
System.Drawing.RectangleF rect = new System.Drawing.RectangleF(upperLeftPoint, rectSize);
g.FillRectangle(solidBrush, rect);
solidBrush.Dispose();
}
示例7: Draw
public override void Draw(System.Drawing.Graphics g)
{
System.Drawing.SolidBrush solidBrush = new System.Drawing.SolidBrush(Color);
System.Drawing.PointF upperLeftPoint = new System.Drawing.PointF((float)(Center.X - RadiusX), (float)(Center.Y - RadiusY));
System.Drawing.SizeF rectSize = new System.Drawing.SizeF((float)(2 * RadiusX), (float)(2 * RadiusY));
System.Drawing.RectangleF rect = new System.Drawing.RectangleF(upperLeftPoint, rectSize);
g.FillEllipse(solidBrush, rect);
solidBrush.Dispose();
}
示例8: PopulateRotationCorrectedTranslationIncrements
private void PopulateRotationCorrectedTranslationIncrements(Angle headingChange)
{
double s = Math.Sin(headingChange.Rads);
double c = Math.Cos(headingChange.Rads);
m_TranslationIncrements.Clear();
System.Drawing.PointF[] featurePointPair = new System.Drawing.PointF[2];
List<TrackedFeature> trackedFeatures = m_VisualOdometer.TrackedFeatures;
m_GroundFeatures.Clear();
for (int i = 0; i < trackedFeatures.Count; i++)
{
TrackedFeature trackedFeature = trackedFeatures[i];
if (trackedFeature.Count < 2)
{
continue;
}
// previous and current feature points need to be in the ground region
if (!(trackedFeature[-1].Y > m_VisualOdometer.GroundRegionTop && trackedFeature[0].Y > m_VisualOdometer.GroundRegionTop))
{
continue;
}
featurePointPair[0] = trackedFeature[-1]; // previous feature location
featurePointPair[1] = trackedFeature[0]; // current featue location
//Debug.WriteLine("Raw:");
//Debug.WriteLine("\tPrevious dx_r: {0:0.000} dy_r: {1:0.000}", featurePointPair[0].X, featurePointPair[0].Y);
//Debug.WriteLine("\tCurrent dx_r: {0:0.000} dy_r: {1:0.000}", featurePointPair[1].X, featurePointPair[1].Y);
ProjectOnFloor(featurePointPair);
//Debug.WriteLine("Ground:");
//Debug.WriteLine("\tPrevious dx_r: {0:0.000} dy_r: {1:0.000}", featurePointPair[0].X, featurePointPair[0].Y);
//Debug.WriteLine("\tCurrent dx_r: {0:0.000} dy_r: {1:0.000}", featurePointPair[1].X, featurePointPair[1].Y);
// Remove rotation effect on current feature location. The center of the rotation is the previous feature location
Point rotationCorrectedEndPoint = new Point(
c * featurePointPair[1].X - s * featurePointPair[1].Y,
s * featurePointPair[1].X + c * featurePointPair[1].Y);
Point translationIncrement = new Point(
featurePointPair[0].X - rotationCorrectedEndPoint.X,
featurePointPair[0].Y - rotationCorrectedEndPoint.Y);
//double translationAngle = Math.Abs(Math.Atan2(translationIncrement.X, translationIncrement.Y));
////Debug.WriteLine(translationAngle * 180 / Math.PI);
//if (translationAngle > acceptedDirectionMisaligment)
//{
// continue;
//}
//m_UsedGroundFeatures.Add(trackedFeature);
m_TranslationIncrements.Add(translationIncrement);
m_GroundFeatures.Add(trackedFeature);
}
}
示例9: ToPointFArray
public static System.Drawing.PointF[] ToPointFArray(DataP3[] data)
{
int n = data.Length;
System.Drawing.PointF[] newData = new System.Drawing.PointF[n];
for (int i = 0; i < n; i++)
{
newData[i] = new System.Drawing.PointF((float)data[i].X, (float)data[i].Y);
}
return newData;
}
示例10: TestDashedLineStartEnd
public void TestDashedLineStartEnd()
{
System.Drawing.PointF start = new System.Drawing.PointF();
System.Drawing.PointF end = new System.Drawing.PointF();
string expectedString = null;
string resultString = null;
resultString = SVGUtil.DashedLine(start, end);
Assert.AreEqual(expectedString, resultString, "DashedLine method returned unexpected result.");
Assert.Fail("Create or modify test(s).");
}
示例11: LabelStyle
/// <summary>
/// Initializes a new LabelStyle
/// </summary>
public LabelStyle()
{
_Font = new System.Drawing.Font("Times New Roman", 12f);
_Offset = new System.Drawing.PointF(0, 0);
_CollisionDetection = false;
_CollisionBuffer = new System.Drawing.Size(0, 0);
_ForeColor = System.Drawing.Color.Black;
_HorisontalAlignment = HorizontalAlignmentEnum.Center;
_VerticalAlignment = VerticalAlignmentEnum.Middle;
}
示例12: Draw
public override void Draw(System.Drawing.Graphics g)
{
System.Drawing.SolidBrush solidBrush = new System.Drawing.SolidBrush(Color);
System.Drawing.PointF[] points = new System.Drawing.PointF[3];
points[0] = new System.Drawing.PointF((float)Vertex1.X, (float)Vertex1.Y);
points[1] = new System.Drawing.PointF((float)Vertex2.X, (float)Vertex2.Y);
points[2] = new System.Drawing.PointF((float)Vertex3.X, (float)Vertex3.Y);
g.FillPolygon(solidBrush, points);
solidBrush.Dispose();
}
示例13: RealProjector
public RealProjector(string name, string uuid, Size imageSize, PointF principal, double focalLength, Screen screen)
: base(name, uuid, imageSize, principal, focalLength)
{
Window = new Window("Pentacorn Projector")
{
LocatedOnScreen = screen,
FullScreen = true,
};
Color = Color.DarkBlue;
Window.Scene = new Scene(new ScreenCamera(Window)) { new Clear(Color.White), };
}
示例14: InvoiceTableView
public InvoiceTableView()
: base(MonoTouch.UIKit.UITableViewStyle.Plain)
{
CellIdentifier = InvoiceLineCell.Key;
SectionHeaderHeight = 30;
RowHeight = 60;
ContentOffset = new System.Drawing.PointF (0, -100);
BackgroundView = null;
BackgroundColor = UIColor.Clear;
AutoScroll = true;
this.ItemTapped = (i) => {
(i as InvoiceLine).ToggleSelected();
};
}
示例15: Init
public static void Init(TestContext context)
{
dp1 = new System.Drawing.Point(10, 10);
dp2 = new System.Drawing.Point(100, 100);
drect = new System.Drawing.Rectangle(5, 5, 15, 15);
wp1 = new System.Windows.Point(10, 10);
wp2 = new System.Windows.Point(100, 100);
wrect = new System.Windows.Rect(5, 5, 15, 15);
fp1 = new System.Drawing.PointF(10, 10);
fp2 = new System.Drawing.PointF(100, 100);
frect = new System.Drawing.RectangleF(5, 5, 15, 15);
}