|
Hi,
My code draws a large graphic (e.g. a rectangle) and the window initially displays only part of it because the window size is small. When I enlarge the window, it will show the whole graphic. However, instead of enlarging the window, if I scroll the scroll bar to the right, then the graphic will be redrawn so I always can only see the first part of the graphic and cannot see the remaining part. How can I fix this display problem to see the whole graphic? Thanks in advance for your help.
|
|
|
|
|
Read "Professional C# - Graphics with GDI+" here at cp.com.
Should be: http://www.codeproject.com/books/1861004990.asp
Cheers
Sebs
|
|
|
|
|
I need an Information icon (similar to System.Drawing.SystemIcons.Information) but I need to resize it down to (16,16), does anyone know how I go about doing this in C#?
|
|
|
|
|
I want to invoke the format command of OS(XP) im my C# code:
string VolumeName = "UDISK";
string FormatW2K = "CMD.EXE";
string FormatW2KParam = string.Format("/C \"format.com {0}:/q/x/V:{1}\"",driverletter,VolumeName);
Win32.ShellExecute((IntPtr)0,"open", FormatW2K, FormatW2KParam, string.Empty, Win32.SW_SHOW);
I have got two problems:
1,the format function always compels me to click the Enter key to go on the format operation.I want to my code can do it for me.So,my program will invoke the Format command and do format operation automatically and never bother me.Then how to realize my dream?
2,When the Format command has been invoked,my program automatically perform the following code no matter if the format operation finished or not.But I hope that the following code should be perform as long as the format operation finished.So,how to settle this problem?
Thanks!
|
|
|
|
|
Hi ,
Yeah I m facing one major problem in my project.Here is the situation in which i want help.
Suppose there is one plane page in which one image of Rectangle is placed but it is any where in the page.Now i have to find out the location of that Ractangle in page.For that i m finding any three corner point(in co-ordinate).
by that i can findout the ractangle.
but major problem is that how to find out exact location of that ractangle in a page?
if any one have any clue the tell me.
Regards.,
Hteen24
|
|
|
|
|
You can also construct a Point object by passing a Size object. In this case, the Size object's width will become the abscissa of the Point, and the Size object's height will become the ordinate of the Point object. For example:
Size mySize = new Size(13, 133);
Point myPoint = new Point(mySize);
System.Console.WriteLine("X: " + myPoint.X + ", Y: " + myPoint.Y);
Sreejith Nair
[ My Articles ]
|
|
|
|
|
Does anyone know how to reliably compare two .NET exe files to see if they are the same (except for time stamps and version information)?
I have several C# projects that I build and I would like to compare results of different builds to see if anything has changed. I am testing by doing two complete rebuilds of a C# project one right after the other and comparing the two resulting exe files. But every test I run finds the files to be different.
Fc doesn't work. WinDiff doesn't work. Beyond Compare 2 doesn't work. The 'dumpbin /rawdata' trick doesn't work. Even the BinDiff.exe in Windows 2003 Server doesn't work (however it does work well with many non-.NET exe files I have tried).
Any other suggestions?
Thank you,
Ray Gregory
|
|
|
|
|
|
WinDiff does the job. It is shipped with the Platform SDK on MS web site. It's free.
|
|
|
|
|
No, it doesn't work. Remember, he's comparing binary EXE files, not the source files.
--
Weiter, weiter, ins verderben.
Wir müssen leben bis wir sterben.
I blog too now[^]
|
|
|
|
|
WinDiff DOES binary comparison.
There is no spoon.
|
|
|
|
|
But how do you easily see which binary differences aren't logical differences?
--
Weiter, weiter, ins verderben.
Wir müssen leben bis wir sterben.
I blog too now[^]
|
|
|
|
|
Ray Gregory wrote:
Does anyone know how to reliably compare two .NET exe files to see if they are the same (except for time stamps and version information)?
In addition to what Daniel wrote (and in case you don't necessarily need to compare/view the C# code) you could use the IL disassembler from the SDK to disassemble the exe files and compare that. Basically the same suggestion as the one Daniel made but without installing new tools.
ildasm foo.exe /out=foo.il
Best regards
Dennis
P.S. A really cool open source diff tool I use instead of WinDiff is WinMerge[^].
|
|
|
|
|
Informex has recently moved into beta a tool called IXSnapIn Assembly that allows you to compare .NET Assemblies on local and remote machines. You can compare .NET Assemblies in the GAC or filesystem and results are displayed visually. It's still in an early stage but it may help.
Visit http://www.ixsnapin.com/IXSnapInAssembly.aspx for more information and to download it.
Disclosure: I work for Informex, the developer of this tool.
Glenn Lewis
|
|
|
|
|
Hi all
Can any one explain why C# does not suport for overloading =,.,sizeof,new operators? I am in the need to overload the operator '='.Is there any other way to redifine the functionality of '='.
M.Sendilkumar
|
|
|
|
|
Sendilkumar.M wrote:
Can any one explain why C# does not suport for overloading =,.,sizeof,new operators? I am in the need to overload the operator '='.Is there any other way to redifine the functionality of '='.
Probably because the environment is garbage collected. Those operators you describe are tipically used when you need to implement your own memory management mechanism in C++. This is simply not possible in C#.
About the '.' operator (in C++, the '->' operator), you don't need it because C# has property get/set pairs, so it's a much more elegant and simple solution to the same problem.
Yes, even I am blogging now!
|
|
|
|
|
|
Hi,
From webpage
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/battery/hh/battery/UPS_mini_10660b09-2746-44ea-9f27-5523677ae09e.xml.asp
it says that there is a sample UPS minidriver in the XP DDK at src/general subdirectory. However, my XP DDK has no such directory/subdirectory. It may be that it is old (original XP) and I have ordered the new SP2 version, but in the meantime, does anyone know what this file's name might be or where it might be located in the original XP DDK? If you could provide me with that information or a copy of the file, it would be much appreciated.
Thanks,
Tom
|
|
|
|
|
I have a class where I override GetEquals(), == and != and now need to override GetHashCode(). The class in question has only string data members. Any tips on how to generate a "good" hash code? (I assume I call GetHashCode() on each of the strings then somehow munge the results together, but what's the best way to do that--with my luck, I'll pick a method that results in zero half the time.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
|
In addition to what Daniel said, you should also take a look at a few examples of similar classes by viewing some of your favorite (and similar) classes in ildasm.exe that installs with the .NET Framework SDK or a decompiler like the .NET Reflector[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hello gurus,
I would like to know if there is a data importer in .NET like in the excel's or access' "Import Data" option? Or must I reinvent the wheel?
As most software have this "Import Data" I guess it's already built in .NET but where is it?
Which class does that? I feel this functionality of data import exist in the framework.
Thanks for the answers.
Best regards.
There is no spoon.
|
|
|
|
|
The .NET Framework base class library (BCL) is just that - a class library. It does not - and should not - contain such functions as data import, but should - and does - facilitate it. That's what a base class library is for. It's not a piece of software like Excel - which is a functional product.
Besides, into what format are you importing data? There's no standard format in .NET for data like an XLS for Excel or something. The only thing that comes close is to import data from either a database or an XML file (the serialized representation) into a DataSet . Importing data into your own classes is specific to your implementation.
The BCL facilitates that through I/O classes, data readers and adapters, the DataGrid , and just about anything else you can use to import and manipulate data. How you do that depends on your requirements, but there are classes to help that like the FileStream , the TextReader , a DataReader derivative, the DataAdapter derivatives, and many, many more.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi Heath,
Thanks for your answer.
In a first time, I need to import data from a text file with a delimiter.
I guess that things like ODBC does automatically that. or maybe there is something already done in .NET.
In my 1st esquisse of the importer, I use the DataSet class to store the read data from the text file, and I use the StreamReader to read the contents of the text file.
Storing in a DataSet object the contents of the analyzed text file goes well.
BUT...
The day the data from the text file takes a huge amount of disk space (more than the physical memory itself), the entire data can't fit into the memory. So, we need to read little by little the data. There are several text files that contains exported data from an Database server that are huge in size. Then, using DataSet won't feet in memory.
I guess that MS has done something that matches with this problem, because most software does data importation. In an old time, ODBC was the answer to data importation/exportation.
So, I guess also that .NET provide something like ODBC and text drivers to read data stored in text is a specified formating (separated by a delimiter like coma, tab...)
Best regards.
There is no spoon.
|
|
|
|
|
bouli wrote:
In a first time, I need to import data from a text file with a delimiter.
Why not just read through the file and as you read each line into a string , use the Split method of the string using your delimiter to break it into pieces and the process the results.
- Nick Parker My Blog | My Articles
|
|
|
|