|
thanks
I Wish the Life Had CTRL-Z
|
|
|
|
|
If by "dimension" you mean the width and height of the image measured in pixels, which is what I see in the summary tab, you can use this quick and dirty means.
System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap("MyImage.tif");
int width = bitmap.Width;
int height = bitmap.Height;
bitmap.Dispose();
If you need more info, you could get a copy of the TIFF specification, read the file header, and extract what you need from those bytes.
Hope that helps.
BDF
A learned fool is more a fool than an ignorant fool.
-- Moliere
|
|
|
|
|
thanks for replying
i meant in MM or CM
there is a Image class properties named PhysicalDimension
but that is not worked in the files that i should use
i wanted to avoid converting pixels to dimension by myself
I Wish the Life Had CTRL-Z
|
|
|
|
|
how can i convert linkbutton CommandArgument to sender object in c#.
The same wichi is used in vb.net is ---
CType(sender,LinkButton).CommandArgument
For eg:
I need to get the CommandArgument value of the selected link button from the datagrid. In vb.net i use
CType(sender,LinkButton).CommandArgument
how can be done in c#.
Thankyou,
Yesu
|
|
|
|
|
LinkButton lb = sender as LinkButton
if (lb != null)
{
// The conversion was valid.
}
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function.
Please Help..
|
|
|
|
|
|
Hi,
I want to apply theme for an application. I want to read all controls inside the form
I'm using this code to get controls.
public void ApplyTheme(object ob)
{
System.Windows.Forms.Form f = (System.Windows.Forms.Form)ob;
foreach (System.Windows.Forms.Control ctr in f.Controls)
{
}
}
By using the above code, I can read only parent controls inside the form, can't read the child controls,
Can anybody give me a solution to read all controls including child inside a child also.
Thanks in advance.
Sababathi B
Software Developer as well as Team Coordinator, Working for eXinfoTech
|
|
|
|
|
The solution, is recursion. Have your method call itself so long as ctr has child controls.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Use recursion to get that...
In
foreach (System.Windows.Forms.Control ctr in f.Controls)
{
//Check if ctr again as some child controls and call the method again.
}
Hmmm....but recursion??? I had a problem of StackOverflow exception bcoz of it(in some other application)..
.....
|
|
|
|
|
Spunky Coder wrote: I had a problem of StackOverflow exception bcoz of it(in some other application)..
Well, you need to know what you're doing so you don't cause infinite recursion
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: you don't cause infinite recursion
Well I handled that thing...Actually the application works like the 'Reflector'..So the application loops through the classes(and their properties,innerclasses) and initializes objects at run time ..While looping through StackOverflow exception occurs in the case of a dll having many classes and innerclasses. But i found only recursion as the suitable thing and hence could not avoid it
.....
|
|
|
|
|
Hi Graus,
The following code is working perfectly
private void ReadAllControls(Control Parent)
{
if (Parent.HasChildren)
{
foreach (Control Child in Parent.Controls)
{
GetTheme(Child);
ReadAllControls(Child);
}
}
else
GetTheme(Parent);
}
Try it
Software Developer as well as Team Coordinator, Working for eXinfoTech
|
|
|
|
|
Recursive.
By the way, not all controls are in .Controls, ie Menu
|
|
|
|
|
What is meant by hardcoding values into a program? An explanation with brief example will be highly appreciated.
|
|
|
|
|
First of all I would like to advice you to use a thing they call: Google ... it kinda helps alot.
Secondly, To hard code or hard coding (also, hard-code/hard-coding, hardcode/hardcoding) refers to the software development practice of embedding input or configuration data directly into the source code of a program or other executable object, or fixed formatting of the data, instead of obtaining that data from external sources or generating data or formatting in the program itself with the given input.
Hope it makes sense ...
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Thank you so much. It makes a lot of sense, more than what I found on google.
cheers.
|
|
|
|
|
Wikipedia[^] is also your friend (as well as google).
Dave
|
|
|
|
|
I am doing a GUI design right now. I have all the templates with me which have space allocated for controls. I have added form's background as this image and placed controls in the correct slots. Since background is an image, it's getting slight delay in loading the form. I am looking for an alternative efficient way to load the background image. Any thoughts ?
|
|
|
|
|
Hi,
Only thing I can think of right now is double buffering, or maybe use an image instead of the background image of the form ...
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: maybe use an image instead of the background image of the form ...
Do you mean image in a picture box ? Picture box is poor in performance.
Programm3r wrote: double buffering
Thanks. I will take a look at this.
|
|
|
|
|
|
Hi all,
I am trying to select the cell of a datagrid as a right click occurs on it .... and I am kinda lost. Can anyone please give me some advice ?
Many thanks in advance
Regardsm
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Handle the CellMouseClick event in which check if the mouse click is of right button and then select the particular cell
.....
|
|
|
|
|
Thanks for the reply ...
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|