|
I've loaded an image into a control. Now the User can choose a particular region in the image. Once the user releases the mouse, the entire image has to be zoomed by a specific factor and the scrollbar should be moved to point to the region that the user selected.
Approach: I tried out the followin approach.
I zoomed the entire image and move the horizontal and the vertical scrollbar to the start of the zoomed region.
The problem is: The selected region thats captured corresponds to the original bitmap, but when the image is zoomed the coordinates changes. So is there any way that i can find out the coordinates of the clicked part in the zoomed image.
Any other approach to this problem is also highly appreciated
|
|
|
|
|
Just trying. What if you keep a bitmap object with the original image?
|
|
|
|
|
Hey
I didn't get u. Can u be bit more elaborate. It would be helpful if u could give some sample codes
|
|
|
|
|
either using the scale* on your picture/form or just multiple your coordinates by size.
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
|
Hey guys i was just wonder how i can catch the console output and write it to a text box ? i have been trying to do it via streams. but its to no aval it seems..... does anyone know how ?
Thanks
jesse M
The Code Project Is Your Friend...
|
|
|
|
|
fred.exe > fred.txt
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
I design a webservice with c#,
this webservice have some [WebMethod(EnableSession=true)]'s method
but when I use it with c++,Session lose
why?
thanks, codeproject
|
|
|
|
|
i want to make a text display on a textbox according to what I type in another textbox after I press a button. I am trying to get this to happen on one Main Form several times having the thread stop at each question and then resume after the button is pressed stopping for the next question.I was thinking of using a Thread.Sleep() method but am getting confused pretty quickly being new at programming.
|
|
|
|
|
don't use sleep - it will break your app.
much simpler use a variable with either a number or a enum - this is your state.
every time the use presses the button increate the state and then do which every action is required for that state.
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
Hmmmm,
Say I use XmlDocument to load an XML file off disk, now I cannot call Save on this same file eh? I even tried to call Close on the XmlTextReader used to load the XML but even then it wont let me save to the same file.
THus if I want to edit c:\aaa.xml I need to create c:\aaa1.xml, then del aaa.xml and rename aaa1 to aaa. I dont like this at all.
Anyone knows how to overcome this?
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Just a thought: was the file read-only?
|
|
|
|
|
|
It seems to work, at least with .NET 1.0. The following code does what it is expected to do :
System.Xml.XmlDocument d = new System.Xml.XmlDocument();
d.Load(@"c:\opml.xml");
XmlNodeList elemList = d.GetElementsByTagName("outline");
for (int i=0; i < elemList.Count; i++)
elemList[i].Attributes.Append( d.CreateAttribute("myattrib") );
d.Save(@"c:\opml.xml");
|
|
|
|
|
|
Does somebody know how to assign and build key accelerators using C#?
Or does someone know how to activate these accelerators in C++?
|
|
|
|
|
Dear reader,
I want to write a program wich will be used as some kind of MSN-like tool to chat with other users of my LAN. Does anyone know how to build such applications using C++, Java or C#?
I think it can be done using IP-numbers!
Thank you in advance
|
|
|
|
|
There are lots of chat program sample in this site for both C++ and C#. I guess they can help you.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Hi, to build a LAN chat software is not a problem, but to analyze what you want it to do is the main thing. You can contact me for more details about this dennisroy.glofleet@gmail.com. This will be done with C# using the UDP functionality.
|
|
|
|
|
I need to write a program which uses 2 forms, one for the standard interface, and one for advanced options.
I can't write a program which asks for some information in the second form, and then passes it to the first form. I've declared the 2nd form in the first one.
How can I build a program with those two cooperating forms?
Thank you in advance,
Boudewijn Ector
|
|
|
|
|
Wouldn't that be simply be a case of declaring a public method in the second form which supplies that information, and then calling it from the first form:
class SecondForm : Form
{
...
...
public AdvancedInfo GetAdvancedInfo()
{
...
...
}
...
...
}
class FirstForm : Form
{
...
SecondForm mySecondForm;
...
...
void SomeMethodThatNeedsAdvancedInfo()
{
AdvancedInfo info = mySecondForm.GetAdvancedInfo();
...
}
}
Does that help?
Pete
|
|
|
|
|
Thanks, Pete
But I knew that already, the real problem is that my 1st form needs to know when I've entered the data in the second form. So the 2nd must somehow tell the first one that he's ready.
|
|
|
|
|
Sounds like a candidate for events. Basically form2 'publishes' a 'FormChanged' event, and then form1 'subscribes' to that event.
If you haven't dealt with events and delegates in C# before, be warned: it can be confusing at first MSDN and CodeProject articles will explain it a lot better than I can..
That said, you'll want something along the lines of:
public class form2 : Form
{
public event EventHandler FormChanged;
...
...
protected void SomeClassThatChangesForm2()
{
...
...
if( FormChanged != null )
FormChanged( this, new EventArgs() )
...
}
...
}
public class form1 : Form
{
...
...
protected void Form2ChangedHandler( object sender, EventArgs e )
{
...
...
}
...
...
public form1()
{
...
this.form2.FormChanged +=
new EventHandler( Form2ChangedHandler );
...
}
...
}
Does that make any sense at all to you
Hope it's helped a little,
Pete
|
|
|
|
|
Hi,
For ages now, I've not been able to insert ANY user controls into my windows forms, they appear on the toolbar, but when i go to insert them, it just says that it cant find the object. this is happening in all of my applications now, and even reseting the toolbar and then adding references from scratch doesn't work. has anyone had any problems like this? or any ideas of how to solve it? all my work has ground to a halt, because i use user controls all the time, and not being able to insert them, and then fiddle with the properties etc makes it very difficult. I can insert them programmatically without any errors though.
any ideas?
thanks in advance!
Dave Kerr
focus_business@hotmail.com
www.focus.esmartweb.com
|
|
|
|
|
I had a coworker with the same problem. His solution was to reinstall visual studio which did the trick for him.
Daniel E. Blanchard
|
|
|
|