It does work I was just forgetting to Save the image! Too Early!
'// Loop Through All Controls In myForm
for each c in myForm.Controls
'// Check To See What Type Of Control This Is
if c.GetType.Name.ToString = "HtmlGenericControl" Then '// HtmlGenericControl =
'// Is This County In Our String Of Counties?
If delimitedData.IndexOf(c.Id) <> -1 Then
'// Draw Around Area Map If Data Is Found
Dim myPoints(100) As Point
dim myGraphics as Graphics
Dim objBitmap As New Bitmap(Server.MapPath("/images/county_map_01.jpg"))
myGraphics = myGraphics.FromImage(objBitmap)
Dim imgCoordinates As String = CType(CType(c, HtmlGenericControl).Attributes("coords"), String)
Dim split As String() = Nothing
split = imgCoordinates.Split(",")
Dim i As Integer = 0 '// Loop Counter
Dim x As Integer = 0 '// Array Counter
While i < split.Length - 1
myPoints(x) = New Point(split(i), split(i + 1))
'response.write (split(i) & " " & split(i + 1) & "
")
i += 2
x += 1
End While
myGraphics.DrawPolygon(Pens.Blue, myPoints)
myGraphics.FillPolygon(Brushes.Blue, myPoints)
Else
'// Set Image To Show There Is No Data
End If
It does work I was just forgetting to Save the image! Too Early!
mrbowling
Member
100 Points
22 Posts
Any Idea Why This Code Wouldn't Work?
Apr 28, 2004 01:55 PM|LINK
'// Loop Through All Controls In myForm for each c in myForm.Controls '// Check To See What Type Of Control This Is if c.GetType.Name.ToString = "HtmlGenericControl" Then '// HtmlGenericControl = '// Is This County In Our String Of Counties? If delimitedData.IndexOf(c.Id) <> -1 Then '// Draw Around Area Map If Data Is Found Dim myPoints(100) As Point dim myGraphics as Graphics Dim objBitmap As New Bitmap(Server.MapPath("/images/county_map_01.jpg")) myGraphics = myGraphics.FromImage(objBitmap) Dim imgCoordinates As String = CType(CType(c, HtmlGenericControl).Attributes("coords"), String) Dim split As String() = Nothing split = imgCoordinates.Split(",") Dim i As Integer = 0 '// Loop Counter Dim x As Integer = 0 '// Array Counter While i < split.Length - 1 myPoints(x) = New Point(split(i), split(i + 1)) 'response.write (split(i) & " " & split(i + 1) & "It does work I was just forgetting to Save the image! Too Early!") i += 2 x += 1 End While myGraphics.DrawPolygon(Pens.Blue, myPoints) myGraphics.FillPolygon(Brushes.Blue, myPoints) Else '// Set Image To Show There Is No Data End If