Dim trimx As String = Session("trimname") Dim roofx As String = Session("roofname") SetColor(IIf(Session("sidingname") Is Nothing, "s1", sidingx)) SetColor(IIf(Session("trimname") Is Nothing, "t1", trimx)) SetColor(IIf(Session("roofname") Is Nothing, "r1", roofx)) If File.Exists("c:\inetpub\wwwroot\acb\bg.jpg") Then File.Delete("c:\inetpub\wwwroot\acb\bg.jpg") End If End If If Request.QueryString("image") = "1" Then DrawBldg1() End If End Sub
With this in mind, see how I defined the roof path as the set of polygons drawing the roof.
Doing the same with the siding, and the trim.
This makes it very easy for DrawBldg2 to receive 3 brush objects with the chosen colors embedded and color the building. One must be careful in what order you draw and fill since a fill can overwrite your drawing of your borders, so generally fill and then draw. So far I haven't found a command to reduce a path by one pixel so that the fill fills your border that you've drawn.
Besides being able to draw/fill paths, you can use a path as a clipping region. This means the corrugation will not exist on the background, but only on the building part specified by the path.
The more I have delved into the GDI+ part of the framework, the more I see potential for it. On a web page there are many potentials for a simple diagram indicating more clearly than anything else what a user should be thinking now to understand something easier. Clicking on certain regions of a highly contextual drawing could evolve the diagram to a state that holds valuable information that would be hard replaced by pages of numbers. Picture a use case drawing program that could keep up with the speed that a client could talk to describe their domain.
So far all my GDI+ experience has been on the web page, and the only limitation that the web page has had versus using GDI+ on the desktop is when drawing a continuous line since each pixel might require a request to the server, so you could generate 100 requests per second this way. There are ways of getting around this that I will go into in the next article. Map server side image maps to regions that can see a point that you have clicked, and other such things allow a discrete drawing system to be developed.
Here are the links and the one book I used to get going on this project in case they may be of use to you.
GDI+ Programming in C# and VB.NET, by Nick Symmonds: this book definitely helped me, but his constant referring to past versions of GDI+ and to Visual Basic 6 were not helpful. The book explains some things well, but was very skimpy on many topics. At the time of this writing it is the only major book on the topic.