|
MrAdar wrote: the user does an action in a picturebox...
At this point, your design is broken. IF there are actions, you probably should not use a picturebox.
MrAdar wrote: how do i cause a second form to show it self lets say..on a push of a button while another form is already running
You really need to buy a book.
You want a modeless form, which means you call Show instead of ShowDialog.
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 )
|
|
|
|
|
Hello,
I have a TreeView control on my .aspx page. When I load the page, for any selected last child node, I want to show its entire path (to the parent first root node) in RED color.
Please can anyone tell me how I can achieve this?
Thank you.
|
|
|
|
|
I am writing a backup program and the user would like to enter the name or IP address of a machine and then my program would grab all the shares (I only care about the folders) from that machine and backup those folders. Does anyone know how to do this. I have tried using the ManagementClass but cannot figure it out yet.
|
|
|
|
|
Will this[^] article help?
/ravi
|
|
|
|
|
Thank you for the reply. I can get the shares on the local machine by using code (
|
|
|
|
|
Thanks for your reply. I can get the shares on my local machine but cannot get the shares another machine. The user who will be running this application has network admin privileges.
|
|
|
|
|
hi friends and excuse for this long post,
i got some idea from greeeg about making a picture white and black. the method was:
public static bool GrayScale(Bitmap b)
{
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
int nOffset = stride - b.Width*3;
byte red, green, blue;
for(int y=0;y<b.height;++y)>
{
for(int x=0; x < b.Width; ++x )
{
blue = p[0];
green = p[1];
red = p[2];
p[0] = p[1] = p[2] = (byte)(.299 * red + .587 * green + .114 * blue);
p += 3;
}
p += nOffset;
}
}
b.UnlockBits(bmData);
return true;
}
</b.height;++y)>
it takes a picture as the argument and processes it to make it white and black.
then, again greeeg helped me and gave a method to make picture become white and black in a defined timings (like the smooth conversion of colored screen to grayscale when you click 'Turn Off' in strat menu in windows xp):
const float transitionTime = 5000f;
float normalizedTransitionTime = millsecondsSinceTransitionStart / transitionTime;
red = (byte)Lerp(normalizedTransitionTime , coloredPixelR, bwPixelR);
green = (byte)Lerp(normalizedTransitionTime , coloredPixelG, bwPixelG);
blue = (byte)Lerp(normalizedTransitionTime , coloredPixelB, bwPixelB);
and said that the Lerp method is actually works like this:
float Lerp(float amount, float value1, float value2)
{
return value1 + (value2 - value1) * amount;
}
for conversion of a picture from colored state to gray scale in a time like 500 milliseconds i merged the above ideas (of greeeg).
so i changed the first 'GrayScale(Bitmap b)' method to this:
public static bool GrayScale(Bitmap b)
{
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
IntPtr Scan0 = bmData.Scan0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
int nOffset = stride - b.Width*3
byte red, green, blue;
for(int y=0;y<b.height;++y)>
{
for(int x=0; x < b.Width; ++x )
{
blue = p[0];
green = p[1];
red = p[2];
p[0] = (byte)Form1.Lerp(1f, (float)p[0], (float)(.114 * blue));
p[1] = (byte)Form1.Lerp(1f, (float)p[1], (float)(.587 * green));
p[2] = (byte)Form1.Lerp(1f, (float)p[2], (float)(.299 * red));
p += 3;
}
p += nOffset;
}
}
b.UnlockBits(bmData);
return true;
}
</b.height;++y)>
i have just changed the poinings of second 'for'
for example 'p[0]' is as blue in 'blue = (byte)Lerp(normalizedTransitionTime , coloredPixelB, bwPixelB)'
and the result was unsuccessful
have i done a correct work till now? (ofcourse not )
i think the problem is in choosing the second and third arguments of 'Lerp (normalizedTransitionTime , coloredPixelR, bwPixelR)'.
finally, my questions are:
1- what should the arguments be then?
2- can i change Red, Green and Blue colors of picture (to make it gray scale) in an other way (without using the pointers in 'GrayScale(Bitmap b)')?
|
|
|
|
|
Sajjad Izadi wrote: can i change Red, Green and Blue colors of picture (to make it gray scale) in an other way (without using the pointers
Yes, but it would be much slower. This is the fastest way to do it. Sounds like someone else has done all the work for you so far. I'm not sure what you're asking exactly, 'the result was unsuccessful' doesn't tell us much.
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 )
|
|
|
|
|
i don't know how to use these two methods to make a smooth conversion of colored picture to a gray scale one in a ditinct time.
yes, i myself never could guess to use such pointers to do my work. i'm learning from the friends.
|
|
|
|
|
Well, not sure why I would help you if I get a 1 vote for my trouble, but, the fact is, for bigger images, you probably can't. You'd need to create the individual frames first, THEN roll through them, for it to be smooth.
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 )
|
|
|
|
|
you mean to make the frames as an *.jpg in a folder and start to play them in my form like an animation. so the new and i think main question is "how is making a half grayed picture to produce the frames"?
i mean a picture which is not completely colord nor completely gray.
modified on Monday, June 9, 2008 2:04 PM
|
|
|
|
|
Actually, an easier way to do all this. Create your grey image. Then draw it on top of the color one over and over with varying transparency, which you get by setting the opacity of the ImageAttributes class.
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 )
|
|
|
|
|
I am trying to programmatically change the IIS settings for a folder. I have been following the following article, which shows how to use the DirectoryEntry class to manage active directory settings: http://www.codeproject.com/KB/system/everythingInAD.aspx#10
This code has been working to change the settings for the root directory of my folder, the IISROOT/MyAPP folder. My problem is that I need to change IIS settings for the IISROOT/MyAPP/Child folder, but have not been able to get a handle to the child folder using the DirectoryEntry. Is there a way that I can get a DirectoryEntry variable for this child folder, so that I can change the appropriate settings?
|
|
|
|
|
I figured it out. Before setting the path for the MyAPP directory, I created the child directory as an "IIsWebDirectory". When I properly set the path for the parent, the child directory was appropriately filled with files.
|
|
|
|
|
I want to genericize a class so that it can be used in any application. This class loads application settings. The problem is that in order to load the application's settings, I have to use the application's namespace (?) to do it, like so:
namespace MyApp
{
public class AppSettings
{
public AppSettings()
{
somevar = MyApp.Settings.Default...
}
}
}
How do I change it to something like this:
namespace MyApp
{
public class AppSettings
{
public AppSettings()
{
myapp = SomeMagicHappensHere();
somevar = myapp.Settings.Default.blah blah blah
}
}
}
When I hover over MyApp in the constructor show in the first example, it shows the type as "namespace", but I apparently can't cast to that type (or I'm doing it wrong).
Can anyone help?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John,
Right, MyApp is the namespace, just like System is the namespace for System.String. Namespaces aren't types by themselves, so you can't do things to them like you would to classes.
Would something like this work?
public AppSettings(ApplicationSettingsBase settings)
{
} ApplicationSettingsBase is the base class for all project settings. You would construct your AppSettings class like this:
AppSettings settings = new AppSettings(MyApp.Settings.Default); Is that what you're looking for?
Life, family, faith: Give me a visit.
From my latest post: "How differently the psalmist saw it! How blessed -- how truly happy with real joy! -- is the man who delights in the Law of the Lord."
Judah Himango
|
|
|
|
|
Trees/Forest/Blind - many thanks.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
In C:\abc\PiPe Modules\pipe\PiPe\source: "C:\Program Files\CVSNT\cvs.exe" -q update -P -d
ObjectFlatten.cs
CVSROOT=:pserver:vgcoder2@192.168.2.137:2401/piperoot
C ObjectFlatten.cs
Error, CVS operation failed
Tortoise Tip: One or more of your files has a conflict. This means that someone else has altered the
same part of the file as you. Look above for the files marked "C ", and manually edit them to resolve
the conflict.
Unable to understand what the problem could be
|
|
|
|
|
humayunlalzad wrote: Unable to understand what the problem could be
I'm guessing that it might be:
humayunlalzad wrote: One or more of your files has a conflict. This means that someone else has altered the same part of the file as you. Look above for the files marked "C ", and manually edit them to resolve the conflict.
|
|
|
|
|
I assume CVS is your source code evrsion manager, so the answer is really in the Tortoise Tip -
humayunlalzad wrote: One or more of your files has a conflict. This means that someone else has altered the same part of the file as you. Look above for the files marked "C ", and manually edit them to resolve the conflict.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
You know how the xml writer automatically makes the ampersand character (&) into it’s character entity reference ‘&’. Is there anyway of preventing it from doing this. I am working with an application that does not read the file the xml writer creates with an xml parser, therefore the character entity reference ‘&’ reference never gets parsed back to an ampersand. This is causing an error with the application because it does not understand the ‘&’.
|
|
|
|
|
IF you dont quote & it is not valid XML any more.
But if you really want it, just write out the file using the XmlWriter, and then just read over the created file/stream and replace & with & .
|
|
|
|
|
Fix the application that does the reading.
|
|
|
|
|
Hello gurus,
I have a request for you.
I have imported a flat file (delimited text file) into a DataTable from a DataSet . I wish to run an SQL statement such as "SELECT toto as X, count(titi) as Y from MY_TABLE GROUP BY X, ORDER BY X" where 'toto' and 'titi' are field from the MY_TABLE.
How is it possible to do that in C#?
I hope my question is clear. If not, let me know, I'll try to explain in better way.
Best regards.
Fred.
There is no spoon.
|
|
|
|
|
You can use LINQ for that if you have VS2008, else it's not really possible.
|
|
|
|