|
Dear All,
There are numerous sample of SMS sending and reading on web.
But I need to dial a mobile phone and a conversation period .
In this period I want to record the conversation .
Would you please give me any idea?
Mir
|
|
|
|
|
Have you tried to write or plan any code? How can we help you if you've not done some steps?
If the post was helpful, please vote, eh!
Current activities:
Book: Devils by Fyodor Dostoyevsky
Project: Hospital Automation, final stage
Learning: Image analysis, LINQ
Now and forever, defiant to the end.
What is Multiple Sclerosis[ ^]?
|
|
|
|
|
mmdullah wrote: Would you please give me any idea?
Search for "TAPI"
I are Troll
|
|
|
|
|
I am using this code after your modification to reduce the image size and save the reduced image into the xml file but it's still saving the large image not the reduced image. I tried using the reduced_image but it's not working..
picturePhoto.Image = System.Drawing.Image.FromFile(dialogPhoto.FileName);
Graphics reduced_images = Graphics.FromImage(Image.FromFile(dialogPhoto.FileName));
reduced_images.DrawImage(picturePhoto.Image, 0, 0, 200, 300);
memory_stream = new MemoryStream();
picturePhoto.Image.Save(memory_stream, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] imageBytes = memory_stream.ToArray();
xml_document.GetElementsByTagName("Photo")[0].InnerText = Convert.ToBase64String(imageBytes);
xml_document.Save(public_var.file_name);
|
|
|
|
|
To resize an image,
var originalImage = Bitmap.FromFile(imagePath);
var resizedImage = new Bitmap(originalImage, newWidth, newHeight);
I don't know about your requirements but I suggest you look into using a database but if you need to use an xml file may I suggest you save the images to disk and store the paths (relative paths) in the xml file since you'd be storing about 59 KB inside the xml file for each image which may increase the time required to parse the xml file and may make the xml file hit the size limit of the file system if you're storing a lot of images. Again, it's all about the requirements and what would be needed to be implemented in the future of the application.
Eslam Afifi
|
|
|
|
|
actually i need to be in XML not database
|
|
|
|
|
jrahma wrote: picturePhoto.Image = System.Drawing.Image.FromFile(dialogPhoto.FileName);
Graphics reduced_images = Graphics.FromImage(Image.FromFile(dialogPhoto.FileName));
that is creating two images, i.e. two distinct instances of the Image class, each holding the same picture.
No wonder you will get confused.
Furthermore, you should keep the image in a variable, as images need to be disposed of when done.
|
|
|
|
|
Luc Pattyn wrote: Furthermore, you should keep the image in a variable, as images need to be disposed of when done
I'm fiddling with a gallery creation web page, I have the images in a folder but do not have any thumbnails. I wrote a loop through a datatable of image names and check for a thumb, creating a new thumb if it is missing.
I get an outofmemory exception on the second thumb creation, I presume this is potentially caused by not disposing of the image!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yes,
rather than
Graphics reduced_images = Graphics.FromImage(Image.FromFile(dialogPhoto.FileName));
...
reduced_images.Dispose();
it should be
Image img=Image.FromFile(dialogPhoto.FileName);
Graphics reduced_images = Graphics.FromImage(img);
...
reduced_images.Dispose();
img.Dispose();
so both the Graphics and the Image instance get disposed of, keeping you out of OOM trouble.
BTW: using a using construct would make it a bit more elegant.
|
|
|
|
|
Thanks Luc
Luc Pattyn wrote: using a using construct would make it a bit more elegant.
I rarely need an object for a really short period and forever forget the use using, this obviously lends itself to that model, thanks for the reminder!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
You're welcome.
PS: even when using doesn't fit the application, don't forget to dispose of long lived DataTables!
|
|
|
|
|
Is it possible to have one XMLDocument for all MDI Children so that I only need to invoke the .save once from MDI container instead of doing it every time in every child?
|
|
|
|
|
|
You sound like you need to consider using the Observer pattern:
With all the children being registered observers, you just need to fire up the save method in the object (MDI form) and it'll take care of saving the other forms.
If the post was helpful, please vote, eh!
Current activities:
Book: Devils by Fyodor Dostoyevsky
Project: Hospital Automation, final stage
Learning: Image analysis, LINQ
Now and forever, defiant to the end.
What is Multiple Sclerosis[ ^]?
|
|
|
|
|
I have a class called save_changes() in evey MDI child... How can I run that class for every open MDI when I click a button on my MDI parent?
|
|
|
|
|
Well, you can loop over the MdiChildren collection and call that save_changes method on each one.
Eslam Afifi
|
|
|
|
|
I have been asking around to see if there is an existing class method in C# to do this and it appears not so I worked out my own methods if anyone is interested or needs them.
double angle = 45.2413;
double degminsec = angle;
double decsec = (degminsec * 100 - Math.Truncate(degminsec*100)) / .6;
double degmin = (Math.Truncate(degminsec * 100) + decsec) / 100;
double deg = Math.Truncate(degmin);
double decdeg = deg + (degmin - deg) / .6;
And this is to go back the other way:
double angle = 45.4036;
double decdeg = angle;
double minsec = (decdeg - Math.Truncate(decdeg)) * 60;
double sec = (minsec - Math.Truncate(minsec)) * 60;
double degminsec = (Math.Truncate(sec) / 10000) + (Math.Truncate(minsec) / 100) + Math.Truncate(decdeg);
|
|
|
|
|
Posting this as a tip would perhaps be better than in a forum.
|
|
|
|
|
Ok thanks. I'm new to here so not sure how to do that.
|
|
|
|
|
You will find it under articles menu on the top Post Tip & Trick[^]
Tarakeshwar Reddy
There are two kinds of people, those who do the work and those who take the credit. Try to be in the first group; there is less competition there. - Indira Gandhi
|
|
|
|
|
The only problem with these conversions is that you will get incorrect answers. Try running a few tests to see what happens when converting between decimal values and floating point.
txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
How about just doing something like
deg + min / 60 + sec / 3600
Tarakeshwar Reddy
There are two kinds of people, those who do the work and those who take the credit. Try to be in the first group; there is less competition there. - Indira Gandhi
modified on Saturday, March 27, 2010 3:49 PM
|
|
|
|
|
That would be fine except that it is entered in the format
##.####. You would have to use 3 separate input modes otherwise and that isn't practical for surveying.
|
|
|
|
|
Hey all,
I've a dictionary, i sort his keyValuePair set with linq, and now i want to update my dictionary with the sorted set, how can i do that ?
tanks
|
|
|
|
|
I don't think you can update the dictionary.
You must create a new one. Something like this:
Dictionary<int, string> original = new Dictionary<int, string>();
original.Add(2, "absolutely");
original.Add(1, "undoubtely");
var sortedKeys = (from rec in original
orderby rec.Key
select rec.Key).ToList();
Dictionary<int, string> second = new Dictionary<int, string>();
for (int i = 0; i < sortedKeys.Count; i++)
{
second.Add(sortedKeys[i], original[sortedKeys[i]]);
}
[Edit]A different option is to use the SortedDictionary [/Edit]
|
|
|
|