|
Take this approach, used in string search.
pixels are just bytes , and so is a string, go look how Boyer-Moore works for an efficient algorhitm.
|
|
|
|
|
Would I be able to use the algorithm on the byte pointer that is created? Or would I have to convert those bytes into a string? Would the following be a way to implement the algorithm?
Use the first "row" of bytes of the smaller image as the search pattern. Then search the whole byte array of the larger image for the first occurance(if any at all) of the search pattern. If there's a match, check the next "row" of bytes of the larger image to see if it matches the second "row" of bytes for the smaller image, and so on.
Thanks for the reply!
Jon
|
|
|
|
|
Yes you can just use the bytes (in pointer form).
Sorry I was a bit optimistic, but like you describe is correct. Basically search for 1st scanline of smaller image on a scanline basis using a string search approach. You can then be very liberal and move directly to the last scanline of the smaller image and use byte compare.
|
|
|
|
|
How can I catch the event of Minimize button click?
I can't find the event in VS2005, is there an option to get it or do I have to get something else?
|
|
|
|
|
handle the resize event, and if this.WindowState == FormWindowState.Minimized
|
|
|
|
|
Thanks
|
|
|
|
|
hi
you can use this code
private void btnmin_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Minimized;
}
|
|
|
|
|
Ok, here is the situation, I have a form named Worksheet with 2 typed datasets, RevenueDS and CostDS. The form shows all Revenue and Cost entries (in seperate panes) for the current contract. Also the net profit is calculated and printed at the bottom.
It serves it purpose, but people are complaining they cant print.
I need to make a single crystal report that shows all the above information on a single page. From what I gather, I need 2 subreports to accomplish this goal, one for Revenue and one for Costs and then the Net profit somehow will be computed on the main report(havent got that far yet).
The only problem is, I need to use the datasets in the program rather then have crystal reports get the data from the server. This has been no problem for a report with no subreports since I can just use something like:
<br />
WorksheetReport Report = new WorksheetReport();<br />
PrintingForm pf = new PrintingForm();<br />
Report.Database.Tables["Revenue"].SetDataSource(RevenueDS);<br />
Report.Database.Tables["Cost"].SetDataSource(CostDS);<br />
pf.CRViewer.ReportSource = Report;<br />
pf.Show();<br />
However, I can't find a reasonable way to get to the database of the Subreports, as there is no Subreports data member for Report such as:
<br />
Report.Subreports[0].Database.Table["Revenue"].SetDataSource(RevenueDS);
So, what can I do?
Thanks in advance.
Rob
|
|
|
|
|
Hi,
My code like this
public string str = "Provider=MSDAORA.1;user id=scott;password=tiger";
OleDbDataAdapter da ;
DataSet ds = new DataSet();
OleDbConnection con = new OleDbConnection(str);
da= new OleDbDataAdapter("select * from dept", con);
da.Fill(ds, "dept");
dataGridView1.DataSource = ds.Tables["dept"];
I want data entered in the datagridview is updated when i click update button.
In the button click event i write da.update(ds,"dept"),but it is giving the following exception: "Update requires a valid UpdateCommand when passed DataRow collection with modified rows."
In INSERT button click i write like this:
DataTable dt=new DataTable();
dt = (DataTable)dataGridView1.DataSource;
DataRow dr = dt.NewRow();
dt.Rows.Add();
dataGridView1.DataSource = dt;
Please help me.
Thanks in advance
|
|
|
|
|
if you want update your data in datagridview in data base you must first define sqlcommandbuilder before your update command:
SqlCommandBuilder sc=new SqlCommandBuilder(DataAdaptorname);
|
|
|
|
|
I tried in this way also
decimal dn=Convert.ToDecimal(textBox2.Text);
string d=textBox3.Text;
string l=textBox4.Text;
string i="insert into dept values(dn,d,l)";
da.InsertCommand=new OleDbCommand(i,con);
da.Update(ds, "dept");
It is not giving any error,But updations are not taking place against oracle database.
Please help me.
|
|
|
|
|
maryamf told you the problem.
|
|
|
|
|
Hi,
in Oracle server, after insert/update execute COMMIT statement for permenent changes in the database.
regards,
uroojknan
-- modified at 2:40 Saturday 27th May, 2006
|
|
|
|
|
Ok so I have this code, and it gives me an error (Root XML row not found).
Now I know that this is a-looooot of mess, so if you can make it better that's even better.
So here is the code, and if anyone can tell me why it throws this error and how can I fix it, I would just thank him
Program.YSLFileStream = new FileStream(FileName, FileMode.Open, FileAccess.ReadWrite, FileShare.None);
MemoryStream ms = new MemoryStream();<br />
StreamReader TempStreamReader = new StreamReader(Program.YSLFileStream);<br />
StreamWriter sw = new StreamWriter(ms);<br />
string strSchema = System.Security.Cryptography.VigBinEncDec.BothStrDecrypt(TempStreamReader.ReadToEnd(), "***KeyHere!!!***");<br />
strSchema = System.Security.Cryptography.Base64Decoder.Base64StrDecode(strSchema);<br />
<br />
TempStreamReader = new StreamReader(ms);<br />
sw.Write(strSchema);<br />
sw.Flush();<br />
YSLDS.ReadXmlSchema(TempStreamReader);<br />
sw.Close();<br />
sw.Dispose();<br />
TempStreamReader.Close();<br />
TempStreamReader.Dispose();
Oh and I have checked it out, insted of MemoryStream I used a FileStream and the XML was good!
-- modified at 15:19 Friday 26th May, 2006
|
|
|
|
|
You probably just have to reset your MemoryStream. After you write everything and before you read, do this:
ms.Seek(0, SeekOrigin.Begin);
|
|
|
|
|
Thanks
|
|
|
|
|
How Caan i Rotate a line with a S pecified Degree?
So What !!!
|
|
|
|
|
If you are familiar with Graphics programming and matrix transforms this[^] might help.
|
|
|
|
|
hi
i want know that what is shell protection and how to do that ?
and how to protect my exe from copy (with shell protection) ?
|
|
|
|
|
|
shell protection is the mechanism that protect from exe files . and i want to protect exe files.
how to do that ?
|
|
|
|
|
Protect .exe files from what? Decompilation?
|
|
|
|
|
Hello,
I have a connection string in my config file. That connection string is used to connect to the SQL server. However, the server requires the userid, and password to connect. These two values I will be retrieving from the registry.
Now, how can I append these two values to my connection string, so that the application will use it to connect ot the server.
Thank you.
|
|
|
|
|
Well, if you change the connection string using ConfigurationManager, you'll have to save it and that will leave your user id and password in the config file. What I would suggest that you do instead of pulling the user id and password from the registry is one of two things: 1. Use integrated security and impersonate a Windows user; 2. Secure your config file using the method described here:
Encrypting Configuration Information Using Protected Configuration[^]
|
|
|
|
|
Thank you.
I was looking over that solution.
Since I am using TableAdapter to fill the tables, etc.. I can set, get the string from the property on the adapter, I will just append the password to the end of the string, and will use it like that.
Thank you again
|
|
|
|