my code :
IEnumerable<Blob> bb = from element in bloblist
let locationx = element.Rectangle.X
let locationy = element.Rectangle.Y
orderby locationy ascending ,locationx descending
select element;
foreach (var b0 in bb)
{
listBox1.Items.Add(b0.Rectangle.X + " " + b0.Rectangle.Y);
}
it’s work correctly but my purpose:
1.orderby locationy ascending ,locationx descending
2.if locationy[i+1]-locationy[i]<10
3.then : orderby locationx descending , locationy ascending
4.continue
example:
Sorted(x,y) Desired
--------- ---------
x y x y
30 0 35 7
35 7 30 0
15 20 30 27
25 25 25 25
30 27 15 20
could anyone help me?
It’s hard to tell exactly what you are asking for, but it looks like this should get you to the desired value:
That should give you a set of (X,Y) pairs sorted by descending X value.