|
Thanks, you're right
i solved the problem...
http://pmartike.deviantart.com/
|
|
|
|
|
pmartike wrote: pictureBox1.CreateGraphics();
To further clarify, you should never do this
1 - it's a waste of a picture box, the picture box does nothing
2 - if your form is obscured, what you drew will be erased
Draw in your paint event, or create a Bitmap and assign it to the picture box. Draw on it first if you want to, and save it, if you want to do that.
pmartike wrote: Bitmap bb = new Bitmap(pictureBox1.Image);
The issue here is that there is no image inside the picture box, you need to put one in there, and even if you do, CreateGraphics won't do anything to it. It's more like you are drawing on a layer above the control, a layer that is not permanent.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
your & my problem both are same ,read my today(june,27) post
"Problem about bitmap in Visual Studio C Sharp.NET ?"
i solve my half problem by following code:
Bitmap bmp = new Bitmap(pictureBox2.Width, pictureBox2.Height);<br />
Graphics g = Graphics.FromImage(bmp);<br />
Pen p = new Pen(Color.Red, 5);<br />
g.DrawEllipse(p, e.X, e.Y, 5, 7); <br />
pictureBox2.Image = bmp;
*first read my post, if you get any solution then please inform me
|
|
|
|
|
i can't find your post
i resolved my problem too:
<br />
Bitmap bit = new Bitmap(244, 200);<br />
Graphics g = Graphics.FromImage(bit);<br />
g.DrawRectangle(WhitePen, 10,10, 100, 50);<br />
bit.Save("c:\\image.bmp"); <br />
Can you give a link with your post?
http://pmartike.deviantart.com/
|
|
|
|
|
|
When shd we make function static in C#..
We will be able to call function using the class Name. Wat is the advantages of that and wat are the scenarios where we would use static functions
|
|
|
|
|
Sounds like a homework/interview question.
Google for the answers, and if you still don't understand something, be specific with your quesion.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
Tell me a scenario where we are forced to make a function static
|
|
|
|
|
Hello,
I think you really should do what have been suggested bevor!
Is the reason why you posted the question again (which is very rude for the one who tried to help you) that you haven't understood the answer?
I give you a help to search for at google:
"Singleton"
All the best,
Martin
|
|
|
|
|
I have this suspicion you thanked me with that 1 vote, but I'll give you the benefit of the doubt.
To answer your question: Singletons. Factory methods. Helper classes. Lots of other scenarios where your function should/does not need to do anything with the instance variables.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
Vikram A Punathambekar wrote: I have this suspicion you thanked me with that 1 vote
This really sucks!!!
That's why I posted this suggestion[^]
Got my '5' to bring it back in shape!
All the best,
Martin
|
|
|
|
|
Heh, I'm happy to share what little I know, but these little things can be annoying. C'est la vie.
I find it amazing that people like CG, Guffa, you, and a few others plow on with little to no rewards. I'd be happy if I were half as helpful as one of you.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
Vikram A Punathambekar wrote: I find it amazing that people like CG, Guffa, you, and a few others plow on with little to no rewards
There are rewards.
1. Occasionally people thank us.
2. It exercises the brain so it helps retain the information we have, even if we aren't working on a project that uses it at this time.
3. If you are helpful enough you get a different icon next to your name.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
I should have included you as well in my list.
What I meant was that people don't get paid for answering these questions like they do for writing code for their employers.
I sometimes forget instant gratification is a myth. However, I'm still young, still learning and determined to 'plow on' like you guys.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
Here's a thought, if a function has no state, then why would you want to have to create an object instance, to call it ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
That may be a little beyond him
I think I'm going to call my next project "Chuck Norris". It's a sure way to guarantee it's unbreakable.
• • •
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson
|
|
|
|
|
If it is, then there's no point in giving a more direct answer
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
When you can't use the keyword 'this'. (It's basically what Christian said above )
|
|
|
|
|
I strongly advise you to provide at least one static method, you might even want to
call it Main.
|
|
|
|
|
Hello friends,
I am making a small application in which i am reading data from text file
and sending it to speech lib.
In this i want to give pause functionality. Now i want to keep the track of
the line until which the reading has been done. I am storing file name and it's
line number in an xml file. but how should i read the file from specified line number
or word.
Thats my question.
Thanks in advance.
Rahul Kulkarni
|
|
|
|
|
in VB.Net we use StreamReader:
Dim MyFile As New IO.StreamReader(New IO.FileStream("FileAddress", IO.FileMode.Open))
Dim str As String = MyFile.ReadLine
StreamReader is also available in C#
A.E.K
|
|
|
|
|
I'm in a new department that is currently using c++/VS2002.
The lead programmer and myself are have a debate over what the performance differences are between c++ and C#. Googling, I can find only a few things and none of them give a really good comparison. My own feelings are that they are fairly similar overall, but I cannot find any proof.
Can anyone point me where to look to find the info?
Thanks in advance
Tom
|
|
|
|
|
C++ is obviously going to be faster. The *real* question is, how much faster, could you tell the difference for the sort of apps you write, on the hardware it will be run on, and how much more does it cost in man hours to use C++ instead ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
We are building some rather complex applications that all boil down to computational geometry on a complex collections of object. They are really extensions of 3d CAD systems into the manufacturing systems.
We are currently moving from code embedded (think plugin) in CAD system to free standing applications. As a result we really have two issues. The first is a data/object management issue because our data structures become very complex. The text version of the data can be 200+k lines long.
So for these routines, C#'s advantages of no pointers and no memory leaks (both big problems currently) will out way performance issues. The questions on performance have to do with parsing speed and dynamic memory management. Our lead programmer thinks that any system with memory garbage collection has to be too slow by definition and therefore not worth consideration.
The second is a rendering/computationally issues. These will be fairly tightly defined routines where computational speed is an issue, although a difference of 10-20% probably would not be noticed. Especially as processor speeds increase. We are also going to be recoding these for multi-core support, so ease of threading here will be an issue.
In terms of hardware, we are going to be supporting all versions from windows 2000 to vista, both 32 and 64 bit. So porting between these OSs will be a problem. I've seen an article on codeproject that goes over the coding differences between 32 and 64 bit in C++ and it looks like it will be a problem. I believe that .net does this automatically for us. And ultimately Linux, but no customers have requested it. If we limit ourselves to what MONO supports, I think this may be a solution.
This is going to be a 6-8 person project for the next couple of years. We are probably looking at 500k lines of code. So overall programmer efficiency is going to be a really big deal. At a minimum I think that we need to move to VS Team, but am going to have to get more info before I can convince the others.
Thanks for quick reply.
Tom
|
|
|
|
|
Tom Thorp wrote: no memory leaks
Very good joke!
|
|
|
|