EDN Admin
Well-known member
Hi,
I just completed a program to serialize image and text and save it in a XML file.
However, I was trying to extend the concept further. My WinForm has a TableLayoutPanel over it in which each cell has a different image.
Although I am able to save the index i.e row and column number of the picture but I have become really confused about saving picture and its corresponding PictureTag in the same XML file.
I was able to save multiple pictures and their corresponding texts in the XML file based on the index.
<a title="Sample program on SkyDrive http://cid-7cfad5624f27df6f.office.live.com/self.aspx/.Public/WindowsFormsApplication2.zip?sa=309801168" target="_blank" title="Sample program on SkyDrive
Heres the program in which I tried.<br/>
I have three doubts.<br/>
<span style="font-size:x-small <span style="color:#000066; font-family:tahoma,sans-serif 1)
<span style="color:#000066; font-family:tahoma,sans-serif I has to store the .wav file to in the same XML file. A picture box can have a Tag associated with it which can be a text (name of an object in the picture box) or the path of a Recorded .wav.
The path of the recorded wav comes from Form2 where the user can record his/her voice. If the user records the sound and even gives the tag to the picture, then preference is given to the saving/playing the sound.
How do I save and load this wav in the XML file? <br style="color:#000066; font-family:tahoma,sans-serif
<br/>
<span style="font-size:x-small <span style="color:#000066; font-family:tahoma,sans-serif 2) Previously, when the file is not saved and I send the path of the sound file from Form2 to Form1.
<br style="color:#000066; font-family:tahoma,sans-serif
<span style="color:#000066; font-family:tahoma,sans-serif From Form2, I can send a "Text" or a "Path".
<br style="color:#000066; font-family:tahoma,sans-serif
<span style="color:#000066; font-family:tahoma,sans-serif So, if Text has been sent, it should be converted to speech. If Path has been specified, the audio should played in PictureBox click.
<br style="color:#000066; font-family:tahoma,sans-serif
<span style="color:#000066; font-family:tahoma,sans-serif To distinguish between path and the text, I use " : " symbol since the Text(name of an object) will never contain a colon symbol.
<br style="color:#000066; font-family:tahoma,sans-serif
<span style="color:#000066; font-family:tahoma,sans-serif However, the path will.
<br style="color:#000066; font-family:tahoma,sans-serif
<span style="color:#000066; font-family:tahoma,sans-serif Hence, if the Tag of the picture box contains a colon, we can come to know that its a .wav file which has to be played.
<br style="color:#000066; font-family:tahoma,sans-serif
<span style="color:#000066; font-family:tahoma,sans-serif I have been able to do uptil here.
<br style="color:#000066; font-family:tahoma,sans-serif
<br style="color:#000066; font-family:tahoma,sans-serif
<span style="color:#000066; font-family:tahoma,sans-serif However, when I save this sound file in the XML and I load this wav file from there. What will I have to send to the Tag of the PictureBox so that the sound is played?
<br style="color:#000066; font-family:tahoma,sans-serif
<span style="color:#000066; font-family:tahoma,sans-serif How will it distinguish whether the tag is a name of an object (simple text) or the path of a .wav file?
<span style="font-size:x-small <span style="color:#000066; font-family:tahoma,sans-serif 3) Zipping/Compressing the file to reduce its size and unzipping it before use?
<span style="font-size:x-small <span style="color:#000066; font-family:tahoma,sans-serif How is that done?
<span style="font-size:x-small <span style="color:#000066; font-family:tahoma,sans-serif It would be really nice if somebody could help with reference to the sample.
<span style="font-size:x-small <span style="color:#000066; font-family:tahoma,sans-serif Thanks<br/>
View the full article
I just completed a program to serialize image and text and save it in a XML file.
However, I was trying to extend the concept further. My WinForm has a TableLayoutPanel over it in which each cell has a different image.
Although I am able to save the index i.e row and column number of the picture but I have become really confused about saving picture and its corresponding PictureTag in the same XML file.
I was able to save multiple pictures and their corresponding texts in the XML file based on the index.
<a title="Sample program on SkyDrive http://cid-7cfad5624f27df6f.office.live.com/self.aspx/.Public/WindowsFormsApplication2.zip?sa=309801168" target="_blank" title="Sample program on SkyDrive
Heres the program in which I tried.<br/>
I have three doubts.<br/>
<span style="font-size:x-small <span style="color:#000066; font-family:tahoma,sans-serif 1)
<span style="color:#000066; font-family:tahoma,sans-serif I has to store the .wav file to in the same XML file. A picture box can have a Tag associated with it which can be a text (name of an object in the picture box) or the path of a Recorded .wav.
The path of the recorded wav comes from Form2 where the user can record his/her voice. If the user records the sound and even gives the tag to the picture, then preference is given to the saving/playing the sound.
How do I save and load this wav in the XML file? <br style="color:#000066; font-family:tahoma,sans-serif
<br/>
<span style="font-size:x-small <span style="color:#000066; font-family:tahoma,sans-serif 2) Previously, when the file is not saved and I send the path of the sound file from Form2 to Form1.
<br style="color:#000066; font-family:tahoma,sans-serif
<span style="color:#000066; font-family:tahoma,sans-serif From Form2, I can send a "Text" or a "Path".
<br style="color:#000066; font-family:tahoma,sans-serif
<span style="color:#000066; font-family:tahoma,sans-serif So, if Text has been sent, it should be converted to speech. If Path has been specified, the audio should played in PictureBox click.
<br style="color:#000066; font-family:tahoma,sans-serif
<span style="color:#000066; font-family:tahoma,sans-serif To distinguish between path and the text, I use " : " symbol since the Text(name of an object) will never contain a colon symbol.
<br style="color:#000066; font-family:tahoma,sans-serif
<span style="color:#000066; font-family:tahoma,sans-serif However, the path will.
<br style="color:#000066; font-family:tahoma,sans-serif
<span style="color:#000066; font-family:tahoma,sans-serif Hence, if the Tag of the picture box contains a colon, we can come to know that its a .wav file which has to be played.
<br style="color:#000066; font-family:tahoma,sans-serif
<span style="color:#000066; font-family:tahoma,sans-serif I have been able to do uptil here.
<br style="color:#000066; font-family:tahoma,sans-serif
<br style="color:#000066; font-family:tahoma,sans-serif
<span style="color:#000066; font-family:tahoma,sans-serif However, when I save this sound file in the XML and I load this wav file from there. What will I have to send to the Tag of the PictureBox so that the sound is played?
<br style="color:#000066; font-family:tahoma,sans-serif
<span style="color:#000066; font-family:tahoma,sans-serif How will it distinguish whether the tag is a name of an object (simple text) or the path of a .wav file?
<span style="font-size:x-small <span style="color:#000066; font-family:tahoma,sans-serif 3) Zipping/Compressing the file to reduce its size and unzipping it before use?
<span style="font-size:x-small <span style="color:#000066; font-family:tahoma,sans-serif How is that done?
<span style="font-size:x-small <span style="color:#000066; font-family:tahoma,sans-serif It would be really nice if somebody could help with reference to the sample.
<span style="font-size:x-small <span style="color:#000066; font-family:tahoma,sans-serif Thanks<br/>
View the full article