Hello guruz
i have an image , i want to select particullar area of image by pen or bursh and want to save it with erease functionality.
any idea clue , how to do that
regards
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
FroglegRank #1,020 · 1.9K reputationPosted Jan 7, 2011, 12:09 PM EST
nizamani nizamani129 reputationPosted Jan 7, 2011, 6:58 PM EST
exmaple : http://wikimapia.org/#lat=24.8667&lon=67.05&z=10&l=0&m=b
open this link you find a map with option of "Add place" option
wikimapia highlight area of map and we can save it . Excalty in that way i have a picture box contain map in background i want to select any area using floating line (as it is in viki mapia) and wants to save and rease it .
any idea how to do that
FroglegRank #1,020 · 1.9K reputationPosted Jan 7, 2011, 7:17 PM EST
http://blog.csharphelper.com/2010/06/11/let-the-user-draw-polygons-in-c.aspx
nizamani nizamani129 reputationPosted Jan 7, 2011, 8:44 PM EST
1.how can i edit (enlarge , particular sketched area , delete ).
2. I need to save what ever i draw on picture box so for doing that i did this
private void button1_Click(object sender, EventArgs e)
{
Control.ControlCollection coll = this.Controls;
foreach (Control c in coll)
{
if (c != null)
MessageBox.Show("ControlName"+c.Name.ToString()+" - Location X ="+c.Location.X.ToString()+"Location Y="+c.Location.Y.ToString());
}
}
above code does not recognize polygons as control object. as i need to save the location and with their object name ..how can i do that.?
Regards
FroglegRank #1,020 · 1.9K reputationPosted Jan 7, 2011, 9:15 PM EST
To do this you could use serialization
http://blog.csharphelper.com/2010/12/17/use-xml-serialization-to-save-and-restore-pictures-drawn-by-the-user-in-c.aspx
To enlarge you could copy a rectangle slightly bigger than your polygon into a picturebox that has sizemode set to stretched
To delete or edit unsure till I get further information
Tackle one part at a time -ie: Do the saving polygons first, then upload your project so we can work out a way to edit
nizamani nizamani129 reputationPosted Jan 7, 2011, 11:38 PM EST
till yet with your help , map can be saved now with area selected by me , i am trying to add some text on it now .
i need more help from you, i have attached the updated work , just review it .
kindly help me regarding following topics
1. Prevent to Overwrite/ Overdraw on already selected lines
(for this either on paint event i should take array which hold positions of already drawn lines and on mouse / paint / event i should check that either lines are already drawn .)
2. Erase lines / selection
3. enlarge particullar selection
best Regards
FroglegRank #1,020 · 1.9K reputationPosted Jan 8, 2011, 10:37 AM EST