|
Will this application only be used locally? Or are you wanting to connect to a remote database on the net somewhere?
|
|
|
|
|
This app will be running only locally...I am still using the excel sheets but they are not user friendly and also I can't share my app with others due to codesecurity
|
|
|
|
|
create a control inside a thread and update it
i need to create a thread and that thread creates a browser and update the image in browser each time it executes
m geting nulref exception
public void setWebBrowser()
{
Invoke(new EventHandler(workerAddBrowser));
}
void workerAddBrowser(object sender, EventArgs e)
{
if (flag == 1)
{
browser.Refresh();
}
browser = new WebBrowser();
Controls.Add(browser);
browser.DocumentText =/* new Bitmap(File.Open("\\Program Files\\pic\\screen.jpg", FileMode.Open, FileAccess.Read));*/"<img src='file://\\Program Files\\syswifi\\pic\\screen.jpg' width='240' height='320' />";
}
m getting the excepton in line invoke()
and the thread is started like this
objscreen = new screen(sock);
thrdreceive=new Thread(new ThreadStart(receiveSocket));
thrdreceive.Start();
the class is same
This code was posted by me...
|
|
|
|
|
Hi,
I can't tell why exactly you're getting a null reference exception since you didn't provide enough information; look at the line numbers, maybe it is because browser is still null.
I suggest you read two of my articles: the latest one on cross-thread problems, and the one on Visual Studio tricks.
See sig below.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi
I need a code for playing "wav" file via modem.
I work without any component or dll file and just by AT Command and SerialPort.
in my program, i dial to a phone number by this code:
serialPort1.PortName = "COM3";
serialPort1.BaudRate = 9600;
serialPort1.DataBits = 8;
serialPort1.StopBits = System.IO.Ports.StopBits.One;
serialPort1.Parity = System.IO.Ports.Parity.None;
serialPort1.Handshake = System.IO.Ports.Handshake.None;
//serialPort1.DtrEnable = true;
try
{
if (serialPort1.IsOpen) serialPort1.Close();
serialPort1.Open();
serialPort1.Write("ATZ" + Convert.ToChar(13));
serialPort1.Write("AT+FCLASS=8"+ Convert.ToChar(13));
serialPort1.Write("ATDT"+txtTel.Text + Convert.ToChar(13));
serialPort1.Write("AT+VSM=129,8000"+ Convert.ToChar(13));
serialPort1.Write("AT+VSD=128,0"+ Convert.ToChar(13));
serialPort1.Write("AT+FLO=2" + Convert.ToChar(13));
serialPort1.Write("AT+VTX" + Convert.ToChar(13));
}
catch
{
MessageBox.Show("Can not open Port");
}
...
and then send "wav" file by this Function:
private void SendVoiceData()
{
byte[] buffer = new byte[20000];
FileStream strm = new FileStream("voice.wav", System.IO.FileMode.Open);
//MemoryStream ms = new MemoryStream();
//int count= ms.Read(bt, 0, 10000);
rdr = new BinaryReader(strm);
while (true)
{
byte[] bt=new byte[1024];
bt = rdr.ReadBytes(1024);
serialPort1.Write(bt,0,bt.Length);
}
}
Please Help me how can i play a "wav" file via modem.
tnx
|
|
|
|
|
nobody!
|
|
|
|
|
You need to read the documentation for the device that you're trying to play the recording on. If it's possible then that should tell you how to do it.
|
|
|
|
|
there are'nt any Source Code in device documantion.
i need Source!
|
|
|
|
|
Mahyar_Habibpour wrote: there are'nt any Source Code in device documantion
I wouldn't expect there to be. What should be there is a description of all of the features of the device and maybe a reference for the AT commands that the device accepts.
It I were in your shoes here's what I would do: First I'd look for a chapter in the docs entitled "Playing Sound Files Over the Serial Port" or something similar to that. If you can't find anything like that then I'd scour the command set for one that allows you to play a file streamed over the port. If you still can't find anything helpful then I'd go back to the device vendor and ask them how to play a sound file.
Mahyar_Habibpour wrote: i need Source!
There's no way that anyone here can give you that. Your question doesn't contain nearly enough information to even begin thinking about source code; it's missing information like what research you've done, what you've tried so far, what kind of device it is, what makes you think it can even play wav files, etc.
That statement raises a larger issue anyway. If the only way for you to accomplish something is for someone to give you the code then I dare say you aren't cut out to be a software engineer. If that's the way it is though then go back to where you got the code to connect to the device and look there for how to play a file.
|
|
|
|
|
|
HI all,
I am using a datagridview control on a form and one of the columns is defined as datagridviewtextboxcolumn type. This column is used to display and amount and the cell is editable allowing the user to modify the amount. I already formatted this column as "N0" so when the user moves the focus to amother element this cell displays the amount as a number (eg: 1,000,000 for 1 million). Anyway, I want to be able to format this value as number as the user types the amount... so instead of getting 10, and then 100 and then 1000... 100000 as he types, I would like to show 10.. 100 .... 1,000 .... 100,000 so the user won't have to count how many zeros he typed. I already implemented such a feature in a standalone textbox control using the TextChanged event, but I am unable to implement this in the gridview.
Is it possible to achieve this in a gridview cell? What event(s) should I implement to get this functionality working? I am opened to any suggestions or comments!
Thank you in advance!
Andrei
|
|
|
|
|
Hi
you told the solution already
you have to create a user control of datagridview column type with the number textbox you created and make column type of No as the newly created datagridview column.A sample code for customized datagridview column type is available with in the msdn
If you can't just mail me
regards
shine.paravur@gmail.com
|
|
|
|
|
If i want to crop a rectangle of the used part of a bitmap, what is the easiest way to do it?
|
|
|
|
|
Just create a new bitmap, get the pixel from original bitmap and set the pixel to new bitmap using GetPixel and SetPixel.
|
|
|
|
|
But how can i know where are the empty pixels and where there are used pixel ?
For Example:
I will get in one of the iteration a Bitmap with 1000X1000 pixels but the DLL that i used only used 15X28 in location (523,724)
in the bitmap, How can i get a new Bitmap with the size of 15X28 that contain only the crop of location 523,724 ? (Every iteration will be with different size and with different location).
(In the next iteration i can get Bitmap with 500*500 , used size 123*243 and the location will be in 23*342 for eample)
Every time i will want a new Bitmap with only a crop of the used part of the old Bitmap.
How can i do it?
|
|
|
|
|
Hi,
the one way with decent performance goes like this:
- create a new bitmap with appropriate size;
- call CreateGraphics on it;
- perform Graphics.DrawImage using an overload that lets you choose part of a source image
- if necessary, save the bitmap in the format you like
- Dispose of the objects you no longer need.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
There is no source image, every time i will get Bitmap with another size and i want to cut the unused part, lets say that i will get Bitmap with the size 500X500 but there is only one small rectangle size 10X15 that locate in Point 124,254 in the orignal Bitmap and i want to get new Bitmap with the size 10X15 that contain the pixels from location Rectangle ( Location(124,254), Size(10X15)) but the only thing that i have is the bitmap.
If i had the Rectangle of the used parts of the bitmap ,for example, i could just Clone the bitmap with this Rectangle, but how can i get this Rectangle?
|
|
|
|
|
the image you have IS the source image, the bitmap you draw into is the destination image.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
I like you, you're such a nice, humble person.
|
|
|
|
|
If I understand correctly, your problem is locating the image you want to crop inside the bitmap.
You said that it will always be a rectangle, and you talk about "empty" and "full" or "used" and "unused" pixels.
This simplifies your problem a lot! You should be aware that image recognition is a rather complex field, and without these two assumptions you would have to go for complex solutions.
Now, if you know the characteristics of the "empty" or "unused" pixels, you can recognize them. Fox example, they might be all of the same color (white ? black ?). So, starting from the corners of the image you can detect the first "used" pixels and define your cropping rectangle.
How you do it is strongly dependant on the inner image characteristics. For example, if ALL of the inner image's pixels are different from the "unused" ones (different color, in my example), then you can walk along the diagonals of your bitmap to find the cropping area and then define it by walking along its edges if necessary, and so on.
Hope this gives you some ideas.
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
Hi,
I am working on a windows application in which I have to send a http url to a server which returns me the data which i have to enter to a hash table.
I am unable to create the http connection to the server.
Please help how can i write that method
url is smthing like in which i have to paas 2 parameters which returns me a string .
e.g.
http://202.87.50.140:6000/Services/asd.getprice?Item=$Item$&Code=$Code$
|
|
|
|
|
Hi,
do you get any exception/error when opening the connection? (If you just wanted to know how to build a httpconnection, use HttpWebRequest and HttpWebResponse).
Regards
Sebastian
|
|
|
|
|
Actually I don't know how to write code for that .. I am really new to this ..
|
|
|
|
|
|
WebClient LobjWebClient = new WebClient();
string LstrData = LobjWebClient.DownloadString("http://www.google.com");
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|