float to int ?

  • Thread starter Thread starter MAY
  • Start date Start date
M

MAY

hi,

i have problem to convert from float to int,

Point[] i_pt;
PointF[] f_pt;
.....
how to make
i_pt=f_pt;
??

thx..!

MAY
 
Point[] i_pt;
PointF[] f_pt;
....
how to make
i_pt=f_pt;
??

if i were you, i would make static method for conversion:
(i belive there's better solution, but i'm not aware of it)

public static Point [] FloatToInt (PointF [] pts)
{
Point [] intPoints;
int i = 0;
foreach (PointF p in pts)
{
intPoints.X = Convert.ToInt32 (p.X);
intPoints.Y = Convert.ToInt32 (p.Y);
i++;
}
return intPoints;
}


Jeti
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top