Log in

View Full Version : stuck making a tbox with 4 dtms



sjlou
02-16-2012, 07:51 AM
like the title said im trying to make a tbox with 4 different dtms

something like this
http://desmond.imageshack.us/Himg577/scaled.php?server=577&filename=tbox.png&res=medium

var lo,lb,rb,ro,xlo,ylo,xbl,ybl,xrb,yrb,xro,yro:intege r;
rbox: TBox;

begin


lo := DTMFromString('maQEAAHicE2RgYAhkYmAIAeIwKI2Mo4A4C4 grgTgFiMuBuAiIE4E4GIjzgDgaiEuB5uQDcREQpwFxPMhcIHYC YiskDJIvBmJzKLYE4hIGiH4GdlaGT69fEo1B6tGxEdAYSjEjED NBMQuZGAMAAExSLrA=');
lb := DTMFromString('mqAEAAHicE2FgYAhmYmAIAeIwIE4E4hwgLo OKwXAQEAcCcQxUHiYWAcRJUPW5QBwLxJZAM22B2AoNOwOxNxDH AnEQELsAsTkUFwBxCRAXQXExEJdCMQM7K8On1y/xYpAaZAwTw6bGCGgkNTEjEmahAsYGAK5CM80=');
rb:= DTMFromString('mPwEAAHic42dgYFjIxMAwB4jnAfFUIO4E4k oofy4Ug9Q0QdkgNR1QNZ5A/d5A7AelYTgSiJOBuASIc4DYHYibgLgViFugmJWNjeHttx94MUg NNnVGQP3kYkYoZiEDowEAaGg0Hg==');
ro:= DTMFromString('mPwEAAHic42dgYNjIxMCwHohXAfESIJ4JxL 1QMRheDcSLoOIbgHgGEE8F4lag/nogbkbDZUCcAsSBQOyDhL2guA2I2VmZGT7+fks0BqmHYSOgfnI xIxCzkInRAADJYDK1');


FindDTM(lo,xlo,ylo, MsX1, MsY1, MsX2, MsY2);
FindDTM(lb,xbl,ybl, MsX1, MsY1, MsX2, MsY2);
FindDTM(rb,xrb,yrb, MsX1, MsY1, MsX2, MsY2);
FindDTM(ro,xro,yro, MsX1, MsY1, MsX2, MsY2);


rBox.X1 := xlo,ylo;
rBox.Y1 := xbl,ybl;
rBox.X2 := xrb,yrb;
rBox.Y2 := xro,yro;
end;

fre
02-16-2012, 07:59 AM
to make TBox;

var
box:TBox;
begin
box.x1 := 100;
box.y1 := 100;
box.x2 := 200;
box.y2 := 200;
end;


So only the x or the y cooridinate, you store both in .x or .y

I hope you understand this.
If not jus ask for a clearer explanation.

sjlou
02-16-2012, 08:03 AM
i know how to make a tbox lol..
but i want to make a tbox with the cords i find with the 4 dtms

Bonfield
02-16-2012, 08:03 AM
you could use pointtobox

EDIT is it always a box? could you take the top left, then bottom right then turn that into a tbox, if not you might have to make a function that turns the points into a polygon

PointToBox(point(dtm1.x, dtm1.y), point(dtm4.x, dtm4.y));

Chris
02-16-2012, 03:39 PM
I thought it worked like this:
http://i42.tinypic.com/2igzotx.jpg
If this is true, then its not possible to do it with 4 DTMs

Bonfield
02-17-2012, 10:48 AM
how did you go with this?