create circle image HELP!!
hi all,
I need of your help!!!
I want to create an image dot.png that is circle filled with white color.
I used followin code:
Code:
Dim bmp As Bitmap = New Bitmap(64, 64)
Dim g As Graphics = Graphics.FromImage(bmp)
g.FillEllipse(Brushes.White, 8, 8, 48, 48)
bmp.Save("d:\dot.png")
I would like to obtain following image:
http://www.youimages.org/public/imag...25dot_good.png
meanwhile I obtain following image:
http://www.youimages.org/public/imag...433dot_bad.png
So the result in google earth is different. I would like to obtain following result (obatined with dot_good):
http://www.youimages.org/public/imag...image_good.jpg
meanwhile i obtain following one:
http://www.youimages.org/public/imag...6image_bad.jpg
it seems that dot_good has shaped border but i cannot obtain it with my code.
Can someone help me?
thanks in advenced
Gio
Re: create circle image HELP!!
Okay, I quickly wanted to test this before responding so made an associated program as below:
vb net Code:
Dim startx As Integer
Dim starty As Integer
Dim currentx As Integer
Dim currenty As Integer
Private Sub DrawCircle()
Dim e As System.Drawing.Graphics
e = PictureBox1.CreateGraphics
e.CompositingQuality = Drawing2D.CompositingQuality.HighQuality
e.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
e.FillEllipse(Brushes.Lime, startx, starty, currentx, currenty)
End Sub
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
Call DrawCircle()
startx = startx + 5
starty = starty + 5
currentx = currentx + 5
currenty = currenty + 5
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
End Sub
The above creates a continuous line of circles overlapping and growing larger on each tick of a timer within PictureBox1.
I'm not entirely sure what you're after, you seem to have posted two similar issues.
To make a smooth border like the first white circle use:
vbnet Code:
Dim bmp As Bitmap = New Bitmap(64, 64)
Dim g As Graphics = Graphics.FromImage(bmp)
g.CompositingQuality = Drawing2D.CompositingQuality.HighQuality
g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
g.FillEllipse(Brushes.White, 8, 8, 48, 48)
bmp.Save("d:\dot.png")
Re: create circle image HELP!!
Quote:
Originally Posted by
OhGreen
Okay, I quickly wanted to test this before responding so made an associated program as below:
.....
To make a smooth border like the first white circle use:
vbnet Code:
Dim bmp As Bitmap = New Bitmap(64, 64)
Dim g As Graphics = Graphics.FromImage(bmp)
g.CompositingQuality = Drawing2D.CompositingQuality.HighQuality
g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
g.FillEllipse(Brushes.White, 8, 8, 48, 48)
bmp.Save("d:\dot.png")
Hi OhGreen,
thanks for your replay. You focused my issue.
The dot.png is used to obtain image on google earth
Anyway created dot with your code is not enought with smooth border as I obtain following image:
http://www.youimages.org/public/images/131016image.jpg
So I visualize always an image on Google earth with tube effect.
Meanwhile with dot_good i obtain an image without tube effect:
http://www.youimages.org/public/images/131643image1.jpg
Any suggestion?
thanks again
gio
Re: create circle image HELP!!
Okay first off is that background image saved on your computer and loaded into a picturebox?
Re: create circle image HELP!!
Quote:
Originally Posted by
OhGreen
Okay first off is that background image saved on your computer and loaded into a picturebox?
the image is a screenshot of kml file. In kml file I have following code:
Code:
<IconStyle>
<color>ff0000ff</color>
<scale>0.4</scale>
<Icon> <href>dot.png</href> </Icon>
<hotSpot x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
</IconStyle>
and the kml file is placed on same dir where there is dot.png.
Re: create circle image HELP!!
You have a screenshot of the kml, you then load that screenshot into a picturebox?
What do you mean by "dir"? and what is dot.png?
I realise English may not be your first language but please try to explain your situation/problem in a bit more detail, remember all I know is what you tell me.
Re: create circle image HELP!!
Quote:
Originally Posted by
OhGreen
You have a screenshot of the kml, you then load that screenshot into a picturebox?
What do you mean by "dir"? and what is dot.png?
I realise English may not be your first language but please try to explain your situation/problem in a bit more detail, remember all I know is what you tell me.
yes, you are right, my english is not my native language but I try to explain better.
I developed a tool that creates kml file. Output is i.e. :
Code:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>test.kml</name>
<Style id="s_ff0000ff">
<IconStyle>
<color>ff0000ff</color>
<scale>0.4</scale>
<Icon> <href>dot.png</href> </Icon>
<hotSpot x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
</IconStyle>
<LabelStyle> <color>ff0000ff</color> <scale>0.6</scale> </LabelStyle>
<ListStyle></ListStyle>
</Style>
<StyleMap id="m_ff0000ff"> <styleUrl>#s_ff0000ff</styleUrl> </StyleMap>
<Style id="s_ff00ff00">
<IconStyle>
<color>ff00ff00</color>
<scale>0.4</scale>
<Icon> <href>dot.png</href> </Icon>
<hotSpot x="0.5" y="0.5" xunits="fraction" yunits="fraction"/>
</IconStyle>
<LabelStyle> <color>ff00ff00</color> <scale>0.6</scale> </LabelStyle>
<ListStyle></ListStyle>
</Style>
<StyleMap id="m_ff00ff00"> <styleUrl>#s_ff00ff00</styleUrl> </StyleMap>
<Folder>
<name>test.kml</name>
<open>0</open>
<Placemark>
<styleUrl>#s_ff0000ff</styleUrl>
<Point>
<coordinates>7.84053,43.8547,0</coordinates>
</Point>
</Placemark>
<Placemark>
<styleUrl>#s_ff00ff00</styleUrl>
<Point>
<coordinates>7.8404,43.8547,0</coordinates>
</Point>
</Placemark>
<Placemark>
<styleUrl>#s_ff00ff00</styleUrl>
<Point>
<coordinates>7.84042,43.8547,0</coordinates>
</Point>
</Placemark>
</Folder>
</Document>
</kml>
You can save it and open with google earth.
How it works:
google earth(GE) reads this kml file and it creates points on some place specified by longitude and latitude. In my example I considered only two points. GE needs of an image *.png (in this case dot.png) to draw point on map so I must specify in kml file where GE can find dot.png; if I don't specify the path where there is dot.png, I cannot see anything on google earth. So I need to place dot.png in the same directory where there is test.kml.
My goal is to insert in my tool a portion of code in order to create dot.png image. I used your code and it correctly creates this image but I don't see colors of points as specified in image reported above but I see the image with tube effect.
The dot.png good is obtained by another professional tool (Mapinfo) and I would like to reproduce exactly it.
I hope to be clear
gio