|
-
Feb 8th, 2012, 12:11 PM
#1
Thread Starter
Addicted Member
create circle image HELP!!
-
Feb 9th, 2012, 05:55 AM
#2
Hyperactive Member
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")
-
Feb 9th, 2012, 07:20 AM
#3
Thread Starter
Addicted Member
Re: create circle image HELP!!
 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:

So I visualize always an image on Google earth with tube effect.
Meanwhile with dot_good i obtain an image without tube effect:

Any suggestion?
thanks again
gio
-
Feb 9th, 2012, 07:47 AM
#4
Hyperactive Member
Re: create circle image HELP!!
Okay first off is that background image saved on your computer and loaded into a picturebox?
-
Feb 9th, 2012, 09:55 AM
#5
Thread Starter
Addicted Member
Re: create circle image HELP!!
 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.
-
Feb 9th, 2012, 10:38 AM
#6
Hyperactive Member
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.
-
Feb 9th, 2012, 02:33 PM
#7
Thread Starter
Addicted Member
Re: create circle image HELP!!
 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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|