|
Stop asking to be jumped upon.
|
|
|
|
|
Hello
If i have a string how i can split it into character
Ex:
200134 i want to have 2;0;0;1;3;4
Thanks a lot
Assaf
|
|
|
|
|
you can access individual characters in a string by indexing string[index] ;
you can convert the entire string to a char array String.ToCharArray()
and you can look that up in the documentation; I think you best start studying C# in a book !
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
|
Does anyone know how I can load a png or a jpg, change it's DPI ( so change the metadata that represents the DPI settng, NOT resize the image ) and then save that change ?
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 )
|
|
|
|
|
|
Great - thanks.
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 Christian,
AFAIK a PNG just holds pixels, it does not know resolution or physical dimensions.
JPEG supports "properties", they populate what gets handled by
Image.PropertyItems, Image.GetPropertyItem(), Image.SetPropertyItem()
IIRC you can not add properties to an image, but you can modify the existing ones;
and they are indexed by number, so you need to figure out the index for each property.
Here are some of them I once found on the web:
propNames.Add(0x010E, "ImageDescription");
propNames.Add(0x010F, "EquipMake");
propNames.Add(0x0110, "EquipModel");
propNames.Add(0x0112, "Orientation");
propNames.Add(0x011A, "XResolution");
propNames.Add(0x011B, "YResolution");
propNames.Add(0x0132, "DateTime");
propNames.Add(0x0128, "ResolutionUnit");
propNames.Add(0x0131, "SoftwareUsed");
propNames.Add(0x0201, "JPEGInterFormat");
propNames.Add(0x0202, "JPEGInterLength");
propNames.Add(0x0213, "YCbCrPositioning");
propNames.Add(0x501B, "ThumbnailData");
propNames.Add(0x502D, "ThumbnailResolutionX");
propNames.Add(0x502E, "ThumbnailResolutionY");
propNames.Add(0x5090, "LuminanceTable");
propNames.Add(0x5091, "ChrominanceTable");
propNames.Add(0x829A, "ExifExposureTime");
propNames.Add(0x9003, "ExifDTOrig");
propNames.Add(0x9004, "ExifDTDigitized");
propNames.Add(0x9204, "ExifExposureBias");
propNames.Add(0x9209, "ExifFlash");
propNames.Add(0x927C, "ExifMakerNote");
propNames.Add(0x9286, "ExifUserComment");
propNames.Add(0xA002, "ExifPixXDim");
propNames.Add(0xA003, "ExifPixYDim");
Hope this helps.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Awesome - I'll try that if need be. Thanks.
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 )
|
|
|
|
|
how can i leave the for when i found what seach about
i put an if condition in a for loop if this condition is true i want leave the for?
thanks in advance
Assaf
|
|
|
|
|
You can use the "break" keyword like so:
for (Int32 i = 0; i < 10; i++) {
if (i == 8)
break;
}
There is also the "continue" keyword, so continue the loop with the next item.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
If you don't intend the loop to finish, consider using a while loop 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 )
|
|
|
|
|
Please don't do this. It's really bad practice because it indicates that you haven't really thought about what you are trying to do. There are other constructs that are better suited to this:
bool found = false;
int counter = 0;
do
{
if (loop[counter] == 1)
found = true;
} (while !found || ++counter == loop.Count); This doesn't rely on any "hacks". Seriously, if you find that your design implements the for (...)break; pattern then consider using a different loop.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Does anyone have any tips or helpful pieces of info for a newbie programmer? Any piece of info is welcome, such as recommended sites, any tips, or even some basic knowledge of C#. Thankyou anyone who reads this and replys, an thanks in advance. -M.S.
|
|
|
|
|
Practice : And practice. And then some more. You can't beat it. Write lots of code - when it works, look at it and understand why it works. When it doesn't, post it here. There are hundreds of people on this forum who enjoy helping the newbies, but only if it seems they have had ago themselves.
Read : Browse the articles here, pick one that is interesting, download the source, and understand it. Don't just cut and paste into your own app - understand what you are cutting and pasting.
Program : Pick a very simple app to write (winform or web ) - such as a CD library. You will have to work on UI design, data access layers etc.
Enjoy : If you don't enjoy what you are doing, don't do it.
Share : If you flick through the articles, they all tackle a specific element. YOu could write an article of how you wrote your first app - ie the CD Library. The problems you hit, how you solved them. Or Blog about it. Link the blog to your sig - you could become a cult coder and we all follow your trials and tribulations as you make your first listbox populate from an access database!
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
1 - buy some good books and work through them. There's no substitute early on for having everything presented in one place, so nothing is missed
2 - set yourself realistic goals. Look for ways to take bite sized chunks so that you continuously learn new things, and learn to do them well. Trying to go too far at once, you get a basic idea and end up cutting and pasting lots of forum code
3 - when you ask for help on a forum and you're given a code snippet, look for any code you don't understand and use google/MSDN to find out exactly what it does. Try changing it and see what other options you have within that sort of code.
Above all, just keep going. We're all still learning, it's just that the longer you've been going, the quicker you learn and the more you already know ( obviously )
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, i'm building a solution that has plenty of forms interacting with each other, based on MDI Parent - child model.
I created instances of them, never closing, just hiding those. I've also got some other forms that perform some analysis that might take a while. What i'm wondering is if it would be a good approach to make this calls to modalform on a different thread, or to only perform the long tasks on these forms on different thread in order to prevent the app to hold.
Thanks for your time. I appreciate all suggestions.
daniel sovino
|
|
|
|
|
Hi,
the rule is to perform long (over 30 msec) operations on extra threads, and all GUI stuff
on the main thread (because Controls are not thread-safe, so having other threads access
some Controls will eventually hang the app).
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Which is better according to coding standard for c#?
this:
<br />
public bool isDraggable<br />
{<br />
get { return _draggable; }<br />
set { _draggable = value; }<br />
}<br />
or this:
<br />
public bool isDraggable{ get; set; }<br />
without using private members? Or is this a matter of personal choice?
rather have something you don't need, than need something you don't have
|
|
|
|
|
There is no overall C# standard.
The second method isn't very useful.
only two letters away from being an asset
|
|
|
|
|
The first code snippet would be a reasonable way to implement accessors for a property in a class.
The second snippet looks like a property declaration for an Interface.
I suggest you read up on the differences between classes and interfaces if you do not understand the difference between these two pieces of code.
Paul Marfleet
|
|
|
|
|
pmarfleet wrote: The second snippet looks like a property declaration for an Interface.
it does, but you can use it in a normal class as well
rather have something you don't need, than need something you don't have
|
|
|
|
|
donsolms wrote: it does, but you can use it in a normal class as well
You can - but it doesn't actually accomplish much.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
You are wrong. What it does is to implicitely create a private field which is accessed (I think this was introduced with .Net 3.5). Up to there you could just create a public field instead but this one has the advantage that you can replace it with a real property/field pair at any time without having to change anything on accessing classes.
Robert
|
|
|
|
|
Robert Rohde wrote: You are wrong. What it does is to implicitely create a private field which is accessed (I think this was introduced with .Net 3.5). Up to there you could just create a public field instead but this one has the advantage that you can replace it with a real property/field pair at any time without having to change anything on accessing classes.
Only from .NET 3.5 onwards. At the time of replying to this post, we had no idea that the poster was using Orcas and not asking questions about current versions of .Net.
Deja View - the feeling that you've seen this post before.
|
|
|
|