|
But if you don't downsize the image or downgrade it in memory you will occupy the exact same resources. I believe all of the .NET and GDI+ render operations are 32bit (even on low bit images). Shrink the size of the bitmap for the display and you will get the desired resource reduction without all of the code.
BTW, image processing ops in GDI+ seem to be a lot slower the display processing from my rather limited testing.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Hi,
Thanks in advance. I have an application which loads the database tables with five different site codes. In future the number of site codes may increase. For each site code 14 files are sent from another server to our server.
I have to write an application which checks for all the files to arrive and converts it into UTF-8 format and then calls the PL/SQL package and this should run parallely.
So I thought of using Multithreading with one thread for each of the site codes with site code as parameter.
Here is the problem I face. For instance, I have a flag which would be set to "No" if the files are missing and "Yes" if the files exist. In multithreading if I have to preserve the variable I have to block the variable from the other threads using it. Suppose for the site code where files arrival get delayed for 5-6 hrs or for some reason and it's thread blocks the variable then the other threads has to wait for this and this is not what I want. And I have set a lot many flags for in this application. Is Multithreading useful in this scenario? Please let me know your suggestions.
Thanks & Regards,
Das.
|
|
|
|
|
Often the primary difficulty in multi-threaded apps is the logical layout. If you have many threads performing the same operation on disperate data sets you should not have one variable shared between them that controls them all. Using good OO techniques you can have one no flag across many different instances.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Hi community!
Ich have a litte problem. I have a string 'str = textBox12'. An now I want to read this textBox like
int a = ConvertToInt16(textBox12.Text);
But this code:
int a = ConvertToInt16(str.Text);
doesn´t work. Sure, but how can I solve this problem? I have no basic approaches, so I bank on you
Thank you very much!
-- modified at 8:02 Thursday 20th July, 2006
|
|
|
|
|
Use this:
int a = Int16.Parse(textbox.Text);
|
|
|
|
|
|
|
Ok, I think I´ve explained it wrong. (Please correct me if I make mistakes with my englisch).
I have a string called 'str'. In this string is one part of a Command. str = "textBox12".
Now, I must read the textBox12. Str says to me, which textBox I must read. In this textBox12 is an integer=12 (for example)
So I want a command like:
int a = ConvertToInt16(str.Text)
str.Text stands for textBox12.Text
I hope I´ve explained it better.
|
|
|
|
|
Ah.- Iterate through the form's
Controls collection to get at the named control.
- Use Int16.TryParse() to convert the
.Text property of that control to an integer. /ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
This is what I had in mind. But I thouhgt there is a simpler way. But ok, I will try it.
|
|
|
|
|
How I can iterate through the forms collection?
|
|
|
|
|
|
so simple? I will work on it and try to solve my Problem.
I'am very pleased how fast the members answer!
|
|
|
|
|
ok, it doesn´t work. I´ve got the error, that I need an object reference for form1.controls.
Can you explain it with other words please?
|
|
|
|
|
string lookForControl = "textBox12";
string foundControlText = "";
foreach(Control ctrl in this.Controls)
{
if(ctrl.Name == lookForControl)
{
foundControlText = ctrl.Text;
}
}
MessageBox.Show("Control " + lookForControl + " has the Text: " + foundControlText);
---
How to get answers to your questions[^]
-- modified at 9:48 Thursday 20th July, 2006
|
|
|
|
|
That code won't work if the target control is in the Controls collection of a container, such as a GroupBox or Panel. You should make a recursive method which iterates ControlCollections searching for a control with the specified name.
An easier way to do this would be to use reflection to get the control by it's name, assuming that the control is not created dynamically. For example:
FieldInfo fi = this.GetType().GetField( "textBoxInfinity", BindingFlags.Instance | BindingFlags.NonPublic );
TextBox txt = fi.GetValue( this ) as TextBox;
txt.Text = "HELLO";
:josh:
My WPF Blog[^]
|
|
|
|
|
You´re right. I noticed it, because my textBoxes were in GroupBoxes .
Reflections...aha....I must read about it, I didn´t heared about reflections. (is this right -> grammar?)
Thanks to you both!
|
|
|
|
|
Schimaera wrote: I didn´t heared about reflections. (is this right -> grammar?)
No, it would be better to say "I had not heard of reflection."
:josh:
My WPF Blog[^]
|
|
|
|
|
|
Totally agree Josh, but as the OP seemed confused already I thought starting simple was the best way to go.
Had the poster come back and said "It does not work because textbox12 is inside a panel", then I would have delved into the obvious recursive method!
---
How to get answers to your questions[^]
|
|
|
|
|
very thoughtful
|
|
|
|
|
J4amieC wrote:
Had the poster come back and said "It does not work because textbox12 is inside a panel", then I would have delved into the obvious recursive method!
My concern was that the OP's confusion might indicate that he/she wouldn't necessarily make the connection between the fact that the TextBox was in a GroupBox and the fact that the provided method did not work as provided.
:josh:
My WPF Blog[^]
|
|
|
|
|
Oh...it was my first thouhgt. I reallized that all Boxes around were detected only. So I tested it without a groupBox and voila it works.
|
|
|
|
|
Thank you very very much! I realized, that I must learn more about this stupid "this"
|
|
|
|
|
Schimaera wrote: Command. str = "textBox12".
shouldn't it be textBox12.Text
and
Schimaera wrote: int a = ConvertToInt16(str.Text)
int a = ConvertToInt16(str)
Best Regards,
Apurva Kaushal
|
|
|
|