|
Member 4590656 wrote: Pngs can be made in 16 bit color depth format so there must be some app/platform that supports their rendering.
There is no rule saying that, you know Maybe the PNG guys were optimistic and forward looking?
Member 4590656 wrote: using the alpha channel with 8 bit grayscale (perhaps superimposed on a black background)
While that would certainly allow you to store 16 bits per pixel, it would make it impossible to (visually) make any kind of sense of the image at all (the same resulting colour can be represented in many very different ways)
Member 4590656 wrote: I saw some stuff on using "textures" to emulate 16 bit detail. One reference alluded to Directx but gave no details.
You could look at HDR, but even that is not "true" 16bit color depth, it is just made to look (close to) that way
|
|
|
|
|
I'm currently experiencing a race condition: my data-receive thread isn't ready by the time it's supposed to receive data
Thread clientThread = new Thread(new ParameterizedThreadStart(ProcessServerResponse));
clientThread.Start(RDclient);
logText("Connected to Server");
String clientRequest = "SYNC|" + strClientPassword;
Byte[] sendBytes = Encoding.ASCII.GetBytes(clientRequest);
tcpClientStream.Write(sendBytes, 0, sendBytes.Length);
tcpClientStream.Flush();
how do I ensure that my ProcessServerResponse() thread is at the .Read() before my main thread sends .Write ?
private void ProcessServerResponse(object client)
{
TcpClient _RDclient = (TcpClient)client;
NetworkStream tcpClientStream = _RDclient.GetStream();
String strTemp;
byte[] message = new byte[Properties.Settings.Default.iReceiveBufferSize];
int iBytesReceivedCount;
while (true)
{
iBytesReceivedCount = 0;
try
{
iBytesReceivedCount = tcpClientStream.Read(message, 0, message.Length);
}
|
|
|
|
|
Have a look at Thread.Join()
|
|
|
|
|
Hi,
In very general terms the writing thread should wait for a ready signal from the reading thread.
void Initialise() {
using (ManualResetEvent mre = new ManualResetEvent(false)) {
Thread t = new Thread(ThreadProc);
t.Start(mre);
...
mre.WaitOne();
}
}
void ThreadProc(Object mre) {
...
((ManualResetEvent)mre).Set();
...
...
}
The reader thread should signal as soon as it can and the writer should delay waiting until it is ready to write. That way the actual wait period will be minimised.
Alan.
|
|
|
|
|
What is the advantage of using a ManualResetEvent over an EventWaitHandle? I always use an ewh in these situations. I don't really understand the difference between these two classes and why you would use one rather than the other.
|
|
|
|
|
ManualResetEvent and AutoResetEvent are both derived from EventWaitHandle . All they do is set the correct EventResetMode in their constructors. Apart from that, they are identical.
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
Hi David,
I doubt that there is any reason to choose one over the other and assume that the Manual and AutoResetEvent derivations are just conveniences that give clarification of intent and self documentation of code. The member documentation shows that none of the EventWaitHandle properties or methods are overridden and only the constructor is new.
When moving over from win32 to .NET programming the extent of the libraries was daunting and for me the sight of any familiar name was welcome. I saw ManualResetEvent, thought I know what that does, and stuck with it!
Alan.
|
|
|
|
|
Alan N wrote: Manual and AutoResetEvent derivations are just conveniences that give clarification of intent and self documentation of code.
Yes, I can see this. Using ManualResetEvent makes it immediately clear that it relies on something elsewhere in the code manually resetting it (I can guess that from the cunning name they chose for this class).
Well, today I have learned something new.
Thanks, all.
|
|
|
|
|
that works great =)
thanks, Alan N
|
|
|
|
|
Is there any way to access the edit box used in ListView.BeginEdit?
I want to set a tooltip on it indicating an error message in certain situations.
|
|
|
|
|
I have a user control that it has many textboxes and i want to fill textboxes by datatable;
what is the best way for it?
Please somebody help me
|
|
|
|
|
What you have done so far, show your code?
Dude,answers on your previous question,isn't good enough?
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
I want to fill my textboxes that these textboxes are in a one user control;
in my user control i have a tablelayout and in this tablelayout i put my textboxes ;
when i trace it ,ctr can find the tablelayout in usercontrol but i don't know how can i access to textboxes that exist in tablelayout?
this is my code:
foreach (Control ctr in mycomponent.Controls)
{
if (ctr is TextBox) // This is correct statement for checking if Object is specific type
{
TextBox tb = ctr as TextBox; // This line cast Object to TextBox
tb.Text = "salam"; //dataSet1.DataTable1[nCount].Text1;
nCount++;
}
}
|
|
|
|
|
farokhian wrote: i have a tablelayout and in this tablelayout i put my textboxes ;
As Groub box, Panel or Table Layout, it is a Countainer. It can hold Other Controls.
foreach (Control ctr in mycomponent.Controls)
{
if (ctr is TableLayoutPanel)
{
TableLayoutPanel tp = ctr as TableLayoutPanel;
foreach (Control ctrtp in tp.Controls)
{
if (ctrtp is TextBox)
{
TextBox tb = ctr as TextBox;
tb.Text = "salam";
}
}
}
}
|
|
|
|
|
oh my dear;
I reaaly thank you;
Good Luck;
Can you suggest me something to improve my coding?
|
|
|
|
|
farokhian wrote: Can you suggest me something to improve my coding?
I am not expert in coding, but i do not know how you code, so it is mearly inpossible (At least for me) to answer that question.
|
|
|
|
|
|
|
Hi
I want to fill about 80 textboxes from datatable.
What is the best way to do this?
|
|
|
|
|
Use SqlDataReader [^]to bind textboxes with value from table.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
Thanks alot;
I work in windowsApplication;
How can i work with repeater;
I think that repeater doesn't exist in windows!
|
|
|
|
|
|
If you do not want to type for each control you can get all controls from Form
foreach (Control ctr in this.Controls)
{
if (ctr is TextBox)
{
TextBox tb = ctr as TextBox;
}
}
Edit: Corrected Code
modified on Wednesday, December 2, 2009 2:41 PM
|
|
|
|
|
Thanks alot;
Is it possible for you that how can i bind each textboxes to each cells of datatable after i write this foreach?
|
|
|
|
|
How do you access your data?
Are you using DataSet or do you create a reader through code?
Those 80 cells, are in Single Row?
|
|
|
|