-
1 Attachment(s)
Drawing Program
I am trying to make a drawing program that will draw the wall layout in plan view of a building/house.
Example
http://img340.imageshack.us/img340/2518/layoutwm8.jpg
I have started with a form with a panel on it.
The part i am stuck on is scaling the wall lengths down to fit in the panel
example
If i draw a line that represents a wall at say 30000 millimeters which is 30 meters
it will run off the screen so i need to scale it down somehow.
Then i need to use the coordinates the user enters to draw a wall for the start x,y coordinates of the next wall and so on and so on.
So is anybody interested in helping me with this program?
I can attach what i have but not sure what to attach as i believe we don't attach all the projects files..
regards
toe
-
Re: Drawing Program
I am interested. You will have to attach all the equivalent parts which are about drawing these walls. Best would be to attach whole main program.
-
Re: Drawing Program
But I have no way of seeing this source code. I would need it to be written in vb6 or earlier. I don't use vbnet.
In a program written in vb6, for a model drawn to a Form, this should look something like this :
' Here comes input of the Y wall coordinate and its lenght on the Y axis, and then...
'assuming a new wall begins in the Y coordinate and heads down
If Y(wall) + Ylength(wall) > Form.height and Y(wall) <= Form.height then
num1 = ( Y(wall) + Ylength(wall) ) / Form.height
for everywall = 1 to number_of_walls
y(everywall) = y(everywall) / num1
ylenght(everywall) = ylenght(everywall) / num1
next everywall
end if
'assuming a new wall begins in the Y coordinate and heads up
If Y(wall) > Form.height and Y(wall) + Ylength(wall) <= Form.height then
num1 = Y(wall) / Form.height
for everywall = 1 to number_of_walls
y(everywall) = y(everywall) / num1
ylenght(everywall) = ylenght(everywall) / num1
next everywall
end if
' walls don't have to head straight up or straight down