473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

playing with Strings

Hello
Lets say i have a string like
String myString ="This is a test";
and say i have an array of wave files that holds the wave form of each
substring in mySting .
say it's
myStringWaveForm[];

i'm going to show myString inside a paintbox so i use something like
g.DrawString(...)

my question is how can i change the colour of each substring, i can draw
each substrin with myString.Substring() , while i'm using PlaySound() to
read it(substring)..

and something else how should i store all my wave file insude one file or at
least store all the wave form one one string inside one file?
Regards
Ehsan Sadeghi
Nov 16 '05 #1
3 1836
Ehsan Sadeghi <eh*******@hotmail.com> wrote:
Lets say i have a string like
String myString ="This is a test";
and say i have an array of wave files that holds the wave form of each
substring in mySting .
say it's
myStringWaveForm[];

i'm going to show myString inside a paintbox so i use something like
g.DrawString(...)

my question is how can i change the colour of each substring, i can draw
each substrin with myString.Substring() , while i'm using PlaySound() to
read it(substring)..
When you call g.DrawString, use a brush of the suitable colour. Strings
themselves don't have any presentation information associated with
them.
and something else how should i store all my wave file insude one file or at
least store all the wave form one one string inside one file?


I'm not sure exactly what you're asking for here, but
BinaryWriter/BinaryReader may well help you.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
Hello
I mean for example i like to show the entire text which is " This is a test"
and then using the wave files which i have first read "This" from the string
and at the same time change its colour ( colour of "This") to "red" while
the rest of the text is in black.

regards
Ehsan
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Ehsan Sadeghi <eh*******@hotmail.com> wrote:
Lets say i have a string like
String myString ="This is a test";
and say i have an array of wave files that holds the wave form of each
substring in mySting .
say it's
myStringWaveForm[];

i'm going to show myString inside a paintbox so i use something like
g.DrawString(...)

my question is how can i change the colour of each substring, i can draw each substrin with myString.Substring() , while i'm using PlaySound() to
read it(substring)..


When you call g.DrawString, use a brush of the suitable colour. Strings
themselves don't have any presentation information associated with
them.
and something else how should i store all my wave file insude one file or at least store all the wave form one one string inside one file?


I'm not sure exactly what you're asking for here, but
BinaryWriter/BinaryReader may well help you.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 16 '05 #3
Ehsan Sadeghi <eh*******@hotmail.com> wrote:
I mean for example i like to show the entire text which is " This is a test"
and then using the wave files which i have first read "This" from the string
and at the same time change its colour ( colour of "This") to "red" while
the rest of the text is in black.


Sure - so you call g.DrawString with "This" with a red brush, then
g.DrawString with " is a test" with a black brush.

Admittedly you might find it easier with a RichTextBox.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Brian Basquille | last post by:
Hello all, What is the syntax for simply playing a WAV file in your program? Am learning VB and have two VB books but don't wanna root through them to find the code. Any help would be much...
1
by: Peter Schmitz | last post by:
Hi, I'm just trying to play a *.wav file, making use of the unmanaged function "sndPlaySoundA" in winmm.dll, but I still got one question: How can I avoid, that the sound file itself has to be...
2
by: Dave | last post by:
Hi, I am writing a c# application that using a directshow to play file and display it on my C# gui, its work just fine but when i try to open another thread in my c# application the file stop...
7
by: Lee Moody | last post by:
I just want quick and easy way to play a .wav file out the standard sound device. It could even be as simple as activating a sound assigned to an existing windows sound event. Any suggestions?...
8
by: shlomi | last post by:
Hello, It's been long time that I'm investigating on how to play Avi file from memory, with no success. What I'm trying to do is to get a scrambled Avi file to memory, fix same data and...
3
by: Tommy DN | last post by:
I've made a program that displays the track that's playing on a (internet)radiostation. The name of the "now playing" track comes from the radiostation's website ( from the statusbar using the...
4
by: fAnSKyer/C# newbie | last post by:
I am using winmm.dll and I found that I can't just suspend it and resume it? What should I do? Any better idea? Should I use thread? and thread.suspend will work? Thanks
5
by: gazza67 | last post by:
Hi, Does anyone know how to check for when a sound has finished playing? I am currently using the SoundPlayer, there doesnt seem to be any event for this - am I missing something? Gary
3
by: Jack | last post by:
Hi, I'm writing a simple wav player (like winamp) and using the SoundPlayer class in c# 2005. Using winform buttons, I can begin playing the sound and stop half-way through the sound using:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.