|
obj is type of "System.Windows.Controls.Image"
System.Windows.Controls.Image myImage = ((Image)obj);
System.Windows.Media.Imaging.BitmapImage bitmapImage = new System.Windows.Media.Imaging.BitmapImage();
bitmapImage = ((System.Windows.Media.Imaging.BitmapImage)myImage.Source);
System.Windows.Media.Imaging.PngBitmapEncoder pngBitmapEncoder = new System.Windows.Media.Imaging.PngBitmapEncoder.PngBitmapEncoder();
System.IO.FileStream stream = new System.IO.FileStream(@"C:\newImage.png", FileMode.Create);
pngBitmapEncoder.Interlace = PngInterlaceOption.On;
pngBitmapEncoder.Frames.Add(System.Windows.Media.Imaging.BitmapFrame.Create(bitmapImage));
pngBitmapEncoder.Save(stream);
stream.Flush();
stream.Close();
Have fun
|
|
|
|
|
Hi,
I am using String Array i split one and i got the result but now i am trying to split it again for more requirements as i spited again i got two line only, I need every single word,
Now tell me please what should i do for that once i spited it and got my result but second time it is displaying only two lines not every single word.
|
|
|
|
|
can u b a little more specific, wat is that u require,Is that u need all the words from a string
Eg:if string is "India is my country", u need result in an array with values {India,is,my,country}.
Is this ur need
|
|
|
|
|
Yes, but I am trying to make it more specific
Suppose I have data of A to Z letters which i split it and got one letter like S from A to Z....
Now as i got S then I did split it again and i got two line only which is S on 0 line and remaining are on line 1.
Now i want to split only line which contains all letters without S.
I think this description will make it easy to understand.
This is what i am trying to do if you are get my points then do replay please...
|
|
|
|
|
Sajjad Leo wrote: I think this description will make it easy to understand.
Hmm, not really. Could you provide a sample?
|
|
|
|
|
I have one mother arraylist which contains no. of arraylist whose count is dynamic.
All childArrayList contains string values. I have to get all unique combinations for all the values in all arraylist.
If motherArrayList contains 4 arraylist, then length of combination string should be 4.
modified on Wednesday, April 1, 2009 2:59 AM
|
|
|
|
|
Use a random number generator to generate positions out of the number of elements remaining, and hten each time, pull out that one value and put it in your new, random list.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hello Friends and Programmers,
thanx for taking interest in my question. Actually, I want to edit the Windows Registry using C# Console application. But, I know that I have to take the System namespace as System.Win32, but what is the other piece of code. I am likely to change the ValueData from default 400 to 100 of MenuShowDelay under the following registry path : HKEY_CURRENT_USER/Control Panel/Desktop/MenuShowDelay. This edit will speed up the up the Listing of menu in the System. Please help me!
Hope to hear from u guys soon,
Rajdeep.NET
|
|
|
|
|
Registry.CurrentUser.CreateSubKey("Control Panel\\Desktop\\MenuShowDelay").SetValue("Value1", "Value2");
Enjoy.
var question = (_2b || !(_2b));
|
|
|
|
|
|
As a followup, remember value2 is of type object, so it does not have to be a string.
With some settings, as you mentioned, you might need to use integers, floats, booleans or other object types.
var question = (_2b || !(_2b));
|
|
|
|
|
Hi friends,
i have a txt file containing email id's like
test.txt
asdf@gmail.com
qwer@gmail.com
zxcv@gmail.com
when user imports test.txt file i want to get the all email id's by comma seperated value... using c#
asdf@gmail.com,qwer@gmail.com,zxcv@gmail.com ....
like this
how can i??
help me plzzz...
icanmakeiteasy
|
|
|
|
|
string[] emails = File.ReadAllLines(@"test.txt");<br />
StringBuilder stringBuilder = new StringBuilder();<br />
foreach(string email in emails)<br />
{<br />
stringBuilder.Append(email);<br />
stringBuilder.Append(",");<br />
}<br />
File.WriteAllText(@"newtext.txt", stringBuilder.ToString());
|
|
|
|
|
thank you... its working
and if the mails are separated by space like this
test.txt
asdf@gmail.com qwer@gmail.com zxcv@gmail.com
now can i get them by comma separated mails...
thank you
icanmakeiteasy
|
|
|
|
|
just change "," with " ".
|
|
|
|
|
thanks...
my input file is
test.txt
asdf@gmail.com qwer@gmail.com zxcv@gmail.com
now i want like this
asdf@gmail.com,qwer@gmail.com,zxcv@gmail.com
???
icanmakeiteasy
|
|
|
|
|
string alltexts = File.ReadAllText(@"test.txt");<br />
string[] emails = alltexts.Split(' ');<br />
StringBuilder stringBuilder = new StringBuilder();<br />
foreach (string email in emails)<br />
{<br />
stringBuilder.Append(email);<br />
stringBuilder.Append(",");<br />
}<br />
File.WriteAllText(@"newtext.txt", stringBuilder.ToString());
|
|
|
|
|
wow that's working.. thank you.....
icanmakeiteasy
|
|
|
|
|
hey guyz m working on voice over ip and text messaging and video conferencing using SIP protocol, i am dsoing this implementation in c# have to submit it as semester project i need help in its coding urgent response is requested if any one can give a working code or a part of a code tht i can work on. I will be greatful for ur coorperation and response regards...
|
|
|
|
|
Sarah!
sarah23626 wrote: hey guyz m working on voice over ip and text messaging and video conferencing using SIP protocol,
if you are really working and need some guidelines or help you should ask queries related to your work.
Not something like
sarah23626 wrote: urgent response is requested if any one can give a working code or a part of a code tht i can work on
Please do put some effort in your project which will not only make you to think and help in your technical career but also gives you a feeling of satisfaction.
Or if you can Rent or Geta Coder for completion of your work on behalf of you...
Have a Happy Coding.....
|
|
|
|
|
Hi,
I am trying to open pdf file which is in Solution explorer i am giving this path in code but still file isn't accessible
string pathtoPdfFile = "\\File\\Computershortcuts.pdf";
System.Diagnostics.Process.Start(pathtoPdfFile);
File is a Folder name in solution explorer and Computershortcuts.pdf is a file.
Kindly tell me what is correct path.
Thnxx
|
|
|
|
|
The only place for a double slash is the start of a network path, not the middle.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
|
Can anyone tell me where i can download Kristopher Johnson's TypedCollectionGenerator from??
Got a 404 with http://www.kristopherjohnson.net/kj/TypedCollectionGenerator
|
|
|
|
|