I have a set of shapes created in visual basic that need to be colored in:
Everything works perfectly; the shapes are all generated where I want them to be. (I'm trying to draw a house) However, how do I color them in? Also, if I do, will the colors overlap (I want that to happen)?something Code:
Public Class Form1 Private Sub btnDraw_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDraw.Click Dim formSurface As Graphics = Me.CreateGraphics 'creates surface Dim world As New Pen(Color.Black, 3) formSurface.DrawRectangle(world, 250, 50, 300, 300) 'world Dim roof As New Pen(Color.Black, 3) Dim roof1 As New Point(325, 200) Dim roof2 As New Point(475, 200) Dim roof3 As New Point(400, 100) Dim roof4 As New Point(400, 100) Dim curvePoints As Point() = {roof1, roof2, roof3, roof4} formSurface.DrawPolygon(roof, curvePoints) 'triangle roof Dim body As New Pen(Color.Black, 3) formSurface.DrawRectangle(body, 325, 200, 150, 150) 'square body Dim sun As New Pen(Color.Black, 3) formSurface.DrawEllipse(sun, 450, 75, 50, 50) 'sun Dim door As New Pen(Color.Black, 3) formSurface.DrawRectangle(door, 387, 300, 25, 50) 'door End Sub End Class
Should I use some function like image.fill? I know that isn't right but I'm looking for something like that.
Thanks!




Reply With Quote
