|
I'm not saying there's a better way, otherwise I wouldn't be asking this question
Ideally I would have expected Microsoft to support separate config files for class library.
Since a dll is always hosted by an executible who's config file overrides all other config files,
there's no point in having a feature like app settings of a class library object that in fact will never be used...
|
|
|
|
|
Hi All,
I want to hide the default icon provided by the form. If I set ShowIcon property of the form to false, then there is no icon displayed in the form even though the user gives the icon at the run time.
is there anyway to know whether the default icon or user specified icon showing currently in the form?
Thanks is advance.
|
|
|
|
|
I think the default icon is also just a normal icon from visual studio.
If you want to hide an icon, set ShowIcon = true, and use a transparent icon.
Then if the user want to set a new icon, just replace the Icon property.
|
|
|
|
|
thanks stancrm. Your idea works fine
|
|
|
|
|
Hi All,
I'm looking for a way to control a winforms application from a remote computer. The situation is as follows:
I wrote a "headoffice" application, and there are 30 shops that use a client application. The headoffice has to be able to "take over" the client application (or computer, even better) from each shop.
I suggested using remote desktop or VNC, but the solution has to be foolproof, with no windows vista firewall questions for the user.
So is there a way to let my client application send screen information to the headoffice application, and accept mouse and keyboard events from the headoffice without having to install additional software? I already tested vncsharp, but without succes because it only supports being a VNC client.
All computers are linked up through a VPN and can "see" each other.
Thanks in advance for suggestions!
Jan
|
|
|
|
|
Member 4323018 wrote: I suggested using remote desktop or VNC
remote desktop is the best solution here, 100%
Member 4323018 wrote: but the solution has to be foolproof, with no windows vista firewall questions for the user.
You're screwed. You can't stop the firewall asking questions without turning it off, or configuring it to not ask, which is probably easier to do with remote desktop than a third party app.
Member 4323018 wrote: So is there a way to let my client application send screen information to the headoffice application, and accept mouse and keyboard events from the headoffice without having to install additional software? I already tested vncsharp, but without succes because it only supports being a VNC client.
I would suggest using GoToMeeting, or Remote desktop. I'd say that trying to write those apps again, just to control one app, is totally insane and a waste of time.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
If I was you I would consider a simple application of my own. Create a Client/Server setup.
The client Prints the screen and sends the info, the server sends mouse and keyboard data for the client to process on the computer.
This is just a simple idea as to how you could achieve something like what you need, but you will want to look at more optimised techniques as print screen and send will most likely be very slow.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Good day
I am using unsafe code to do image processing from my webcam. A clever way of doing image manipulation is using a colormatrix (eg. greyscale conversion). Its performance is very good, but I am now moving on to the task of video recognition...
Is it a good idea to use the "colormatrix" to do recogntion, and if so, how do I access individual pixels and RGB content while keeping performance optimal?
Or should I stick with unsafe code without a colormatrix (ie. just access each pixel manually)?
|
|
|
|
|
If you can use a color matrix to recognise the content of a video, then you're plainly a genius. You should write an article about that.
( a color matrix is basically a per pixel filter, there's no way you can do any sort of recognition with it, not least because it doesn't return anything except a modified image )
You can read my articles on image processing to see how to access the pixels directly.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Sorry, I didn't quite understand how colormatrix works. Thought it might help since it seems to convert images to greyscale faster than manually iterating through pixels.
Using some of your articles and they've helped a lot thanks.
|
|
|
|
|
It does convert to grayscale but that is not going to tell you what an image contains. I assume you are trying to get to the point where you either have back or white pixels (two-tone).
This method is naturally a first instinct for image processing as you can hope to get a 'shape' from this data. But it's not so simple, where do you draw the line for the contrast? you cant use a fixes value because the image will change depending on the lighting.
How is it you intend to detect the shapes of the hands in the image? (assuming you are still attempting the sign language application)
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Yes, you are probably right, a binary image will most likely be my next step. One idea that comes to mind for this is to normalize the image tones and then using a range corresponding to skin tone to extract the hand.
Although I doubt this will be the best method as I'm sure there are better ones out there.
With regards to shapes, "cascade classifiers" is something I am going to have a look at and see if it works. I know it works for face recognition, but will have to see if I can get results on the sign language.
|
|
|
|
|
Well you sure have a big challenge on your hands...
I take it you have seen the bitmap functions for GetPixel() and SetPixel()? This is slow and as you have mentioned using unsafe code - this should be faster. I don't think I have seen any example of another method to obtain/assign pixel data from an image.
One thing that does come to mind (Not tested so can't say it will be good idea) is to just create a 2D array of pixel data from the image and use that data. I don't see you will ever need to set the pixel data back to the image at any point so maybe this is something worth looking into (performance wise)
All the best with your task anyway
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Thanks
I did actually think of that, so it's good to know I'm not the only one that thinks it might work
At the moment I'm getting 30FPS using the unsafe code, so hopefully won't have to resort to that, but will let you know if I end up trying it.
|
|
|
|
|
tvbarnard wrote: At the moment I'm getting 30FPS using the unsafe code
At the moment it seems you are only converting to grayscale which is relatively quick compared to the processing your going to need to throw at it to get your desired end results. Your FPS will soon start to drop
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
lol true
|
|
|
|
|
I am trying to give the custom boder color for the text box in C#. I am using XP operating system and visual studio 2008. I have subclassed the Textbox and override the WndProc method to handle the WM_PAINT message to give the custom border color to the text box.
public class SampleTextBox : TextBox
{
public SampleTextBox()
{
BorderStyle = BorderStyle.FixedSingle;
}
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case 0x000F:
base.WndProc(ref m);
Control control = Control.FromHandle(Handle);
Graphics g = Graphics.FromHwnd(Handle);
ControlPaint.DrawBorder(g, control.ClientRectangle, Color.YellowGreen, ButtonBorderStyle.Solid);
g.Dispose();
break;
default:
base.WndProc(ref m);
break;
}
}
}
public class SampleForm : Form
{
public SampleForm()
{
BackColor = Color.SteelBlue;
}
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x02000000;
return cp;
}
}
}
public class Form2 : SampleForm
{
private SampleTextBox textbox1;
public Form2()
{
textbox1 = new SampleTextBox();
textbox1.Location = new Point(50, 50);
this.Controls.Add(textbox1);
}
}
I am using WS_EX_COMPOSITED extened window style to my form to avoid the filckering because i am doing custom painting in my form. If i use WS_EX_COMPOSITED style with form , the border color of Text box comes with default color, that is black color while opening the form . But if i click and move the mouse in the non client area like border or titlebar of the form, the border color changes to color (Color.YellowGreen) which i specified in the Paint message of Textbox.
If I comment the "cp.ExStyle |= 0x02000000; /*WS_EX_COMPOSITED*/ " line, then the border always comes with the color what i specified in the Paint message of Textbox.
Can anyone please tell why this is happening and how can I achieve the custom border for the text box when WS_EX_COMPOSITED style applied to its parent control(form)?
Thanks in advance.
Mutpan.
|
|
|
|
|
Instead of WS_EX_COMPOSITED you can try like this to reduce flickering:
public class Form2 : SampleForm
{
private SampleTextBox textbox1;
public Form2()
{
this.SetStyle(ControlStyles.AllPaintingInWmPaint |
ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer, true);
this.UpdateStyles();
textbox1 = new SampleTextBox();
textbox1.Location = new Point(50, 50);
this.Controls.Add(textbox1);
}
}
|
|
|
|
|
using the styles "this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer, true);" is not reducing the flickering in the non client area like title bar. So i should use WS_EX_COMPOSITED style.
|
|
|
|
|
i have a problem when i use the httpwebrequest for a page the page is displayed correctly and when but ispostback is always false.
i m sending the viewstate data too but it is still false
how can i make it to true so that i can access the full data.
the code is as follow
static CookieContainer cookieJar = new CookieContainer();
public string PostContenct(string dataPost, string srcuri)
{
Uri uri = new Uri(srcuri);
string data = dataPost;
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri);
request.CookieContainer = cookieJar;
request.AllowAutoRedirect = true;
request.Method = WebRequestMethods.Http.Post;
request.ContentLength = data.Length;
request.ContentType = "application/x-www-form-urlencoded";
StreamWriter writer = new StreamWriter(request.GetRequestStream());
writer.Write(data);
writer.Close();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
int cookiecount = cookieJar.Count;
StreamReader reader = new StreamReader(response.GetResponseStream());
string str = response.StatusDescription;
string tmp = reader.ReadToEnd();
response.Close();
return tmp;
}
thanks
amirzada
|
|
|
|
|
Don't you think this question is more appropriate for ASP.Net forum.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
yea it is system.net class and can b used in both asp.net and c#
thanx alot i have made it.
thanx
amirzada
|
|
|
|
|
I have a variable
byte[] rxData;
And VS is complaining that it is unassigned. However i dont want to assign it as this is done in the switch statement that follows.
does anyone know why it still complains
;switch (rxMessage[3])
{
case 0x46:
for (int i = 4; i <= 1028; i++)
{rxData[i - 4] = rxMessage[i];}
break;
case 0x42:
rxData[0] = 0;
break;
case 0x4f:
rxData[0] = rxMessage[4];
break;
case 0x43:
rxData[0] = rxMessage[4];
break;
default:
throw new InvalidDataException("Error: Incorrect Subcommand type may have been found");
}
|
|
|
|
|
Hi,
maybe you have to initialise rxData first. It is set to null by default, but to assign values to the array (using an index like 0 at nul won't work). It must be initialised like this:
byte[] rxData = new byte[1024];
Regards
Sebastian
|
|
|
|
|
You have not defined the array.
byte[] rxData = new byte[someNumber];
|
|
|
|