|
ya that is ansi only. i have tried with 1252 code page also but i didn't get the result what i am expecting.
|
|
|
|
|
I have a 2d function that can be represented in a grayscale Format32bppArgb bitmap. I simply divide each value of the function by the maximum value in the function then multiply by 255. I use a lockbits routine to set the pixels.
I have a reversible transformation (similar to an FFT) that I apply to the function and I can represent it the same way.
I wanted to store the transform in the bitmap. The trouble is, if I use an 8 bit color depth, it only has 256 discrete levels. This is too coarse for my application (I cannot inverse transform the data stored in the bitmap and obtain the original function). A 16 bit color depth would give me 65536 discrete levels and this would do nicely.
The trouble is, I have not found a way to render a 16 bit color depth bitmap. I seems that the required Format16bppGrayScale and format and the Format64bppArgb are not functional VS. (I use VS 2005). Most of what I have seen for a work around involves scaling the bitmap data to an 8 bit color depth format.
I would like to be able to both store and “see” the transformed function in 16 bit detail. (Having the visualization be based on a bitmap structure isn’t a necessary requirement for me.) I have looked at some alternate approaches (such as directx) for managing this task but I haven’t been able to noodle out exactly how to do it. The Google stuff I’ve found is pretty sketchy on the implementation steps for my limited skills.
Can anyone give me a boost?
|
|
|
|
|
Member 4590656 wrote: Can anyone give me a boost?
Not really. I recent question on one of the forums here suggested to me GDI+ still has some 16-bit limitations hidden deep inside, so you probably will never be able to create a Form or a Panel with sizes above either 32K or 64K. Anyway, trying to display a 4Mpixel image (64K squared) doesn't seem a very good idea either.
Member 4590656 wrote: I have a reversible transformation (similar to an FFT)
I have strong doubts that is even possible. With real numbers you would get rounding errors, with integers you're bound to loose some information on any non-linear transformation you could come up with. You probably mean the inverse transform almost returns the original?
|
|
|
|
|
Screens don't support 16bit colour depth anyway, but I think I have an idea.. There are many more "colours of green" than just the ones with all green and no red/blue, you may be able to get more "perceived colour depth" by using only shades of green and include the "extended green" colours
The required calculations are a bit complex though, and is likely not easily reversible (so you'd need to keep a copy of the actual values as well)
Or you could just split the value over 2 colour components, but that would make the picture hard to interpret visually
|
|
|
|
|
"Or you could just split the value over 2 colour components, but that would make the picture hard to interpret visually"
I toyed with this idea using the alpha channel with 8 bit grayscale (perhaps superimposed on a black background). Again, I wasn't able to wrap my brain around an interpretable implementation. But, I could store the transform this way and present the 8 bit per color image by ignoring alpha. (Pngs can be made in 16 bit color depth format so there must be some app/platform that supports their rendering.)
The monitor limitation is a real concern. I have a graphics card with 64 bit capability but perhaps my lcd is a limiting factor. I know that medical diagnostics applications use 16 bit grayscale but I also know that the monitors are mega expensive.
I saw some stuff on using "textures" to emulate 16 bit detail. One reference alluded to Directx but gave no details.
|
|
|
|
|
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
|
|
|
|