|
Okay. Here's what I've tried. I was successful on doing the simple and easy way that Heath suggested in just having a Graphics g = Graphics.FromImage(bmp) and drawing on the bitmap when in the On_Paint() method of the class I'm working on.
To simplify things for myself, I've changed the Bitmap to an Image and loaded it in from the BMP file and had everything work correctly.
Now for the thing I'm not sure how to do: When I'm in the OnMouseDown() (which is where I would like to call a function to draw a node on the map since I have a Point to do it at), I can't seem to get a Graphics object from my Image object to do the drawing with. What should I do? It obviously can be done since I do it in the On_Paint() function.
Any pointers would be appreciated.
Thanks a bunch,
Mike
|
|
|
|
|
How to add code to the verb action in the file type actions after setting them in installer
Also how to get the file info , with which the application is invoked
I found that it only launches the application but doesnt call the function i specified its name in the verb property in the installer
thanks,
Wella
|
|
|
|
|
Greetings,
I'm new to the C# experience as such and on top of that I use rather a poorman's development tool, without many of VS.NETs nice drag-and-drop features where it comes to layouts etc.
I'm in need of a bar containing a button with a dropdown, a textfield and another button with a dropdown, in that order. Because of the textfield I suppose I'd better not try solving this using a toolbar and its menus. However, being a n00b, that's the only way I'm able to do above from the top of my head (ie without drag-and-dropping most of it).
So my rather embarrassing question is wether someone could spent a sec and hand me a snipplet of above. Yes.. I know Thanks a bunch!
|
|
|
|
|
What happens with events if computer is slow.
Lets say a timer ticks with 50Hz and the event handler does heavy computations that on P4 2GHz are done perfectly but if the program is run on a Celeron 266 and the computations are done slowlier that the timer ticks. What is going to happen to the timer event? Will it wait for the calculation to stop or it will be ignored and what is worse the program is going to crash.
Well if we don't need 100% reliable data a calculation or two may be omitted but it is better that the programs works on the slower computer that not to work at all.
|
|
|
|
|
Zinj wrote:
Lets say a timer ticks with 50Hz and the event handler does heavy computations that on P4 2GHz are done perfectly but if the program is run on a Celeron 266 and the computations are done slowlier that the timer ticks.
Timer runs in its own thread. Thus the timer will fire its event at the same interval whether on a P4 or a P1.
Zinj wrote:
Will it wait for the calculation to stop or it will be ignored and what is worse the program is going to crash.
Why not test it yourself....? I unfortunately dont have 2 PC's to try it on. Perhaps place a lock on some objects, and maybe do each calculation in it own thread, so it can finish on its own time.
One question: why are doing the calculations from a timer event?
Who is this miscrosoft, and what devilish plans have they for us?
|
|
|
|
|
so I think to calculate some equations 30 times a second (motion, physical simulation, etc)
|
|
|
|
|
I guess a Celleron 400 aint gonna cut that (especially doing realtime simulation). From your other post, are doing some DirectX? I would try optimize the calculations.
Who is this miscrosoft, and what devilish plans have they for us?
|
|
|
|
|
Hey what's up coders...
Okay I am changing between two full screen forms. Each form has it's own 24bit 1024 X 768 fancy backround bitmap created in photoshop. When I change between screens there is a very small amount of flicker [and this isn't allowed] .
So what can I do to fix this? I am thinking maybe directx is the key for me but I thought I would write you all first and see.
I am open to any suggestions.
|
|
|
|
|
|
Hey Mark thanks man but me thinks... The flicker comes from the switching of the forms. The drawing comes afterwards... Unless there is another way to tell the form to draw the background..
thanks,
Lata
|
|
|
|
|
although it is a little bit stupid...how about use another graphic object to load that bmp file before display it.
|
|
|
|
|
who can help me reading the header of an avi-file from my C# application?
i want to get some informations like width, height rate/sec. etc.
do i have to use unmanaged code and call API functions?
i am a beginner so maybe someone could send me sample code
|
|
|
|
|
I tried to find or create a c# component to create a query by drag and drop tables and fields (something like Access Query design). Any idea, please help me.
regards.
|
|
|
|
|
There's one in VS.NET....other than that Im not sure.
Who is this miscrosoft, and what devilish plans have they for us?
|
|
|
|
|
www.devcity.com where working on one a while back! Don't know whats happened to it though!
|
|
|
|
|
I tried to integrate a flex program with C# the way I used to integrate with VB6 but nothing is happening.
I want to know the correct way to do it. Is there any DLLs I have to attach?
Pls help me.
Thanks.
kind rgds,
Anjana Aluthwala
|
|
|
|
|
I'm new in working with exe files so i wanna know..
How i can get the size of the header of an exe file. or read data from it.
i read about exe file format and i knew that header size is stored @ 08H. is that true?
if it's true then i tried to read the 8th byte but it contains zero!!
if not then what's true.
thanks 4 All
plextoR
|
|
|
|
|
If you're refering to the PE/COFF header, a lot more is typically involved. Take a look at Shell Extensions for .NET Assemblies[^]. I read the header to accomplish something else but a simple branch in code would get you what you want. There's also an article in MSDN Magazine (you can see it online from MSDN[^]) that contains more in-depth analysis of the header. Either should be a good place to start.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
Thanks Alot but sorry i can't understand what do you mean with PE/COFF . As i told you i'm new with this operations.
i'll read the article .. thanks alot
plextoR
|
|
|
|
|
If you're going to work with executable headers (which aren't just .exe's BTW), you have to know what PE/COFF headers are. The Common Object File Format actually started back on VAX/VMS. Microsoft modified it with a Portable Executable header which contains a sort of bootstrapper that is actually a small DOS executable (yes, even in NT). The PE header is just a bunch of structures with pointers to other structures and a lot of flags. For instance, the difference in the headers for a .exe and a .dll is a single bit.
You can find a couple really great articles about reading PE/COFF headers written by Matt Pietrek for MSDN Magazine at the following locations:
Inside Windows: An In-Depth Look into the Win32 Portable Executable File Format[^]
Inside Windows: An In-Depth Look into the Win32 Portable Executable File Format, Part 2[^]
You may be interested in a utility he wrote called DUMPBIN. Microsoft distributes it with developers studios, so it's probably already on your system.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
Hi,
I am writing a program with a database ( xxxx.mdb), and the data set is displayed on a DataGrid.
I've implemented an Add function to add new record and it's ok.
But I can't delete an existing record. The following code is what I've used.
this.BindingContext[dbProductSet1, "Products"].RemoveAt(this.BindingContext[dbProductSet1, "Products"].Position);
It runs ok, but the record can't be deleted. And, when I later execute:
oleDbDataAdapter1.Update(dbProductSet1);
An error occurs saying: "Update requires a valid DeleteCommand when passed DataRow collection with deleted rows."
Afterward, I added this line and tried again:
dbProductSet1.Products.AcceptChanges();
The error message is gone and it seems ok, but in fact the "deleted" record isn't deleted!!
Can anyone please give me comments?? Thank you!!!
|
|
|
|
|
Once you do DataSet.AcceptChanges() or DataTable.AcceptChanges(), a DataAdapter no longer sees your changes and therefore doesn't call the required command. DataAdapter() uses DataSet or DataTable.GetChanges() to get a DataSet or DataTable with just the changes and it knows (based on state) which rows have been deleted, inserted, or updated. So, as the error states, you need to assign an OleDbCommand to the DeleteCommand property of the OleDbDataAdapter. That way, when it runs across a record that has been marked for deletion, it'll call the appropriate SQL statement to delete the record.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
how can i hide the console in my exe program until i call apon it too be opened (in this case a -console commandline paremeter)
jesse m
|
|
|
|
|
Just shooting from the hip here.
If there isn't any solution buried in the MSDN docs, or some bizarre method lurking on some System object, why not make your program a WinForm that hosts your program and mimics a console instead. That would give you a *much* higher degree of control than you would need (room to grow even).
If you absolutely need to use the Console.Readline/Writeline for i/o, I suppose you could try "hijacking" the streams already supplied by the class for display. The Console class supplies methods for opening and setting the Input/Output streams and TextReaders (respectively).
.. anyway, give it a shot, and good luck.
- Eric
Calling a function is like tying your shoe. Remoting a function is like tying someone else's shoe... while they're running around... in China.
|
|
|
|
|
yeah i think ill just make my own kinda console on a seperate class / dll (ill have more room to grow and do other stuff with it like you said..besides games like tfc definitly dont use a standard C++ console lol)
thanks alot eric for the info..
|
|
|
|