|
private void button1_Click_1(object sender, EventArgs e)
{
List<string> images = new List<string>() { "GreyA.png", "YellowA.png", "AOutline.png" };
AForge.Imaging.Filters.Edges filter = new AForge.Imaging.Filters.Edges();
foreach (var filename in images)
{
Bitmap b = new Bitmap(Image.FromFile(Path.Combine(Application.StartupPath, "images", filename)));
Bitmap filteredBitmap = b.Clone() as Bitmap;
PictureBox pb = new PictureBox();
pb.SizeMode = PictureBoxSizeMode.AutoSize;
pb.Image = b;
flowLayoutPanel1.Controls.Add(pb);
pb = new PictureBox();
// apply the filter
filter.ApplyInPlace(filteredBitmap);
pb.SizeMode = PictureBoxSizeMode.AutoSize;
pb.Image = filteredBitmap;
flowLayoutPanel1.Controls.Add(pb);
}
}
for more info visit- http://stackoverflow.com/questions/14128847/image-matching-algorithm-in-c-sharp[^]
Mouli
|
|
|
|
|
Also be a little more specific: what's the purpose of that comparison? Find out that the person is really John Doe, find out who the person is (oh that's really something totally different, do you understand that?), identify object types by their (fixed) shape at different angles, etc...
|
|
|
|
|
I recently picked up a windows tablet and I'm frustrated that certain games react very poorly to touchscreen input. For example, a single tap registers as moving the cursor to that position rather than clicking, a double tap is a single click, and holding a tap is a right click rather than a click and hold.
I'm curious how viable it would be to write a background utility that could trap touch screen events and then generate more traditional mouse events while enabled. C# is my preference, but if its necessary to do this in c++ or something I can adapt.
So I suppose what I'm asking is:
a) is this possible?
b) if so could someone point me in the right direction?
Thanks!
|
|
|
|
|
I would say that such a thing is not possible on a system-wide basis, because the tap events are "baked" into the OS, and to change them would require rewiring some very fundamental code.
It would be like trying to alter the mouse events on desktop Windows.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I am not sure how to do that or even if it is possible, but have you tried to see if you can change the Touch Actions[^] to achieve what you want?
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|
|
I make Rectangle in windows form using C# ... but the problem is that in out it gives the color fiiled rectangle ... i only need in output just border of the rectangle...why it's happend
any one help me ?
|
|
|
|
|
DO NOT post your question in multiple forums.
You've already posted this question in the .NET Framework forum[^], and in QA[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi
How to control Windows Media Player.?
Example:
In one form, some buttons (play, stop, next, previous and volume control Trakbar) have.
Windows Media Player is playing ...
When we press a button, the Windows Media Player stops or when we press the play button, Windows Media Player continues to play music or when we press the next or previous buttons to change songs.
<a href="http://upir.ir/files92be/1360522732b5.jpg">http://upir.ir/files92be/1360522732b5.jpg</a>[<a href="http://upir.ir/files92be/1360522732b5.jpg" target="_blank" title="New Window">^</a>]
<a href="http://upir.ir/files92be/e66aa789816b.jpg">http://upir.ir/files92be/e66aa789816b.jpg</a>[<a href="http://upir.ir/files92be/e66aa789816b.jpg" target="_blank" title="New Window">^</a>]
|
|
|
|
|
Please do not repost a question you have already asked.
“The best hope is that one of these days the Ground will get disgusted enough just to walk away ~ leaving people with nothing more to stand ON than what they have so bloody well stood FOR up to now.” Kenneth Patchen, Poet
|
|
|
|
|
Hi
How to control Windows Media Player.?
Example:
In one form, some buttons (play, stop, next, previous and volume control Trakbar) have.
Windows Media Player is playing ...
When we press a button, the Windows Media Player stops or when we press the play button, Windows Media Player continues to play music or when we press the next or previous buttons to change songs.
<a href="http://upir.ir/files92be/e66aa789816b.jpg">http://upir.ir/files92be/e66aa789816b.jpg</a>[<a href="http://upir.ir/files92be/e66aa789816b.jpg" target="_blank" title="New Window">^</a>]
<a href="http://upir.ir/files92be/e66aa789816b.jpg">http://upir.ir/files92be/e66aa789816b.jpg</a>[<a href="http://upir.ir/files92be/e66aa789816b.jpg" target="_blank" title="New Window">^</a>]
|
|
|
|
|
I am developing a application with a WebBrowser control that login to site, but it give security alert:
Revocation information for the security certificate for this site is not available. Do you want to proceed?
I want to that its automatically confirm this alert using code.
I find many question on this issue but they are not useful in my case.
|
|
|
|
|
You shouldn't attempt to confirm this automatically. This is a security notification for the user and you should not attempt to circumvent it because you will be hiding potential issues from the client.
|
|
|
|
|
yes I know that, but I want to do it for my use.
|
|
|
|
|
Don't try to find code to hide the issue with the certificate. Instead, fix the issue with the certificate.
If the certificate really is valid, then there's a problem on the computers which are displaying the message. Fix that problem instead. There are some suggestions in this Microsoft Knowledgebase article[^] which might help.
There is no good reason to hide this error from your users.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Installing the certificate of that site on your computer might help.
|
|
|
|
|
Hi All,
I'm new to TDD. I need to return a DTO containing the the details of the Customers referenced by CustomerID in C# as given below.
The Output DTO should contain the following properties:
int CustomerID
String CustomerName
String[] Addresses
Given below are the data repository classes with properties:
Customer class
{
public int CustomerID {get; set;}
public string CustomerName {get; set;}
public int[] AddressId {get; set;}
}
Address class
{
public int AddressId {get; set;}
public string Street {get; set;}
public string City {get; set;}
}
Note: Should be a TDD approach
Please help me with sample code
Thanks in advance,
Ram
|
|
|
|
|
hi
how to restore a sql database programmatically in c#?
|
|
|
|
|
Use the RESTORE command and connect to the database server with an user that has access to do restores. (e.g. server admin)
You can just use the normal SqlConnection and SqlCommands to do that
Important Note: The path to the backup you provide are relative to the SqlServer. If it is not the same server as your application you need to copy the files to the server (or a network share?) first where the database server can restore the backup from.
|
|
|
|
|
Try this: Backing up an SQL Database in C#[^] - it includes code for backup and restore.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
The following namespaces can be used to access SQL Server 2005 programmatically:
Microsoft.SqlServer.management
Microsoft.SqlServer.Management.NotificationServices
Microsoft.SqlServer.Management.Smo
Microsoft.SqlServer.Management.Smo.Agent
Microsoft.SqlServer.Management.Smo.Broker
Microsoft.SqlServer.Management.Smo.Mail
Microsoft.SqlServer.Management.Smo.RegisteredServers
Microsoft.SqlServer.Management.Smo.Wmi
Microsoft.SqlServer.Management.Trace
Backup bkpDBFull = new Backup();
bkpDBFull.Action = BackupActionType.Database;
bkpDBFull.Database = myDatabase.Name;
bkpDBFull.Devices.AddDevice(@"D:\AdventureWorksFull.bak", DeviceType.File);
bkpDBFull.BackupSetName = "Adventureworks database Backup";
bkpDBFull.BackupSetDescription = "Adventureworks database - Full Backup";
bkpDBFull.ExpirationDate = DateTime.Today.AddDays(10);
bkpDBFull.Initialize = false;
bkpDBFull.PercentComplete += CompletionStatusInPercent;
bkpDBFull.Complete += Backup_Completed;
bkpDBFull.SqlBackup(myServer);
Mouli
|
|
|
|
|
The following namespaces can be used to access SQL Server 2005 programmatically:
Microsoft.SqlServer.management
Microsoft.SqlServer.Management.NotificationServices
Microsoft.SqlServer.Management.Smo
Microsoft.SqlServer.Management.Smo.Agent
Microsoft.SqlServer.Management.Smo.Broker
Microsoft.SqlServer.Management.Smo.Mail
Microsoft.SqlServer.Management.Smo.RegisteredServers
Microsoft.SqlServer.Management.Smo.Wmi
Microsoft.SqlServer.Management.Trace
Backup bkpDBFull = new Backup();
bkpDBFull.Action = BackupActionType.Database;
bkpDBFull.Database = myDatabase.Name;
bkpDBFull.Devices.AddDevice(@"D:\AdventureWorksFull.bak", DeviceType.File);
bkpDBFull.BackupSetName = "Adventureworks database Backup";
bkpDBFull.BackupSetDescription = "Adventureworks database - Full Backup";
bkpDBFull.ExpirationDate = DateTime.Today.AddDays(10);
bkpDBFull.Initialize = false;
bkpDBFull.PercentComplete += CompletionStatusInPercent;
bkpDBFull.Complete += Backup_Completed;
bkpDBFull.SqlBackup(myServer);
for more info - http://www.mssqltips.com/sqlservertip/1849/backup-and-restore-sql-server-databases-programmatically-with-smo/[^]
Mouli
|
|
|
|
|
Sir, kind you help me with code to read and send sms through the internet and gsm modem.
Thank you.
|
|
|
|
|
|
Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...
A very quick search using your subject as the search term gave three quarters of a million hits: SerialComm Port to send and receive sms[^]
In future, please try to do at least basic research yourself, and not waste your time or ours.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
hi every body, i use dynamically toolstripmenu to generate menu, i don't know how to prevent form open twice, please help.
this is my code :
ToolStripMenuItem SubMenu = new ToolStripMenuItem(sdr1["description"].ToString(), null, new EventHandler(klikMenu));
private void klikMenu(object sender, EventArgs e)
{
string sFormName = "AIO_System." + ((ToolStripMenuItem)sender).Tag.ToString();
System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
Form frm = (Form)asm.CreateInstance(sFormName); <======
if(!IsFormOpen(frm.GetType()))
{
frm.Owner = this;
frm.Show();
}
else
frm.Focus();
}
}
private bool IsFormOpen(Type formType)
{
foreach (Form form in Application.OpenForms)
if (form.GetType().Name == form.Name)
return true;
return false;
}
|
|
|
|