|
Stop it right now. Don't post another one of these. They're all going to get tagged as spam. Advertising for another site in the forums is highly frowned upon. Buy advertising space like everyone else.
|
|
|
|
|
Sorry I was not aware of this. I have nothing to do with site. Just added assuming that It may be useful for other members.
My Apologies, Give me some time I will delete my post
|
|
|
|
|
Your site promotes no learning, and you're advertising on a board where people help others to make code for free, whereas you want to whore out your code preventing others from learning.
Yeah, you assumed wrong.
|
|
|
|
|
Don't lie on top of it...
"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
|
|
|
|
|
how can a tune sung by a user (humming) be compared with the songs in the database & produce similar results??
since the pitch of man & woman varies widely, how can the results can be made accurate?
|
|
|
|
|
sorry but this is NOT an audio analysis forum
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
Although off-topic, it's a very interesting question. Some high-level ideas:
1. Since the singer's key can vary, you need to transpose all melodies to a common base key. E.g. if you transpose the first note to C for every melody, you can find matches even if the singer is singing in another key.
2. A voice isn't a pure tone. All instruments (except synthesizers using a single oscillator) have harmonics (frequencies higher than the lowest). Fourier analysis will allow you to isolate the different frequency components. Ignore all but the lowest for simplicity.
3. Voices aren't exactly in tune. You will have to round each frequency to the nearest musical tone. The standard is 440 cycles per second for an 'A'. Consecutive chromatic tones have a ratio of 1 : the 12th root of 2. Thus, when you go through the 12 tones of an octave, you get (the 12th root of 2) to the 12th power = 2. So a note an octave higher has twice the frequency of the lower note.
4. The rhythm is also going to be off for a human's performance, so you will need to adjust the lengths of each note with respect to a selected granularity. E.g. round the length of each note to the nearest eighth note.
5. This will "standardize" a melody hummed into an A-to-D converter, allowing you to compare it with the melodies in the database. Of course people will make errors, so if there's no exact match, you need some kind of error metric to find the closest match in your database.
|
|
|
|
|
HI,
have any of you worked with Casswory linear programming.IF yes pleasse do mail me back.have some query with the implementation
|
|
|
|
|
|
thanks. i have implemented the code with my test program.But i m not able to get a optimal solution.so thought to ask in this forum
|
|
|
|
|
Hello,
How can I cut a file in a specific directory and put it in another directory? thank you very much.
|
|
|
|
|
You can use classes in System.IO namespace
|
|
|
|
|
System.IO.File.Move("oldFileName", "newFileName");
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
Hello,
I have two C# Applications one client side, one server side, which communicate via a web service that I am creating also. I wanted to create a class library so that classes that are used between the three applications can be re-used. I want to allow one of the webmethods in the web service to accept an object of one of the classes I have created in the class library but when I try and pass it from either application it says I can't because the types are different.
ABSWebService.Market doesn't equal ABSClassLibrary.Market (Event though in the web service it is referencing the Class Library to get the Market).
I have tried to cast it to the other type, but this isn't allowed either.
Any suggestions?
|
|
|
|
|
If you are using a WCF Service, when you add the service reference there is a setting for "Re-use classes in referenced assemblies".
If you're using old-fashioned web methods I think you're S.O.L.
|
|
|
|
|
Well I have only just started creating this, so I was using Web Services as that is what I know. But if it will work with WCF I will try that instead.
Just to add to the complexity the class library needs to be able to access another external web service that isn't mine, and all the applications need to create and pass objects of this web service type. Should I just forget Class Libraries?
|
|
|
|
|
Hello ,
how we can transform a file from Word to PDF and from PDF to Word?
Thank you verry mutch
|
|
|
|
|
You can do it using Adobe Acrobat. If you want to do it programmatically you need to search for third party library. There are several free and commercial ones available.
|
|
|
|
|
You can use the PDFCreator(PDF Printer) for transform any file to a PDF file.
Any developers write a program to convert in PDF but I don't have a program to convert PDF to Word.
|
|
|
|
|
Thank you for your answer, i would transform pdf to word and word to pdf using myprogram in C#, thank you verry mutch.
|
|
|
|
|
I am having difficulty in keeping the alpha channels in my images when I open them into a c# pictureBox.
Having spent a couple of days searching forums and things I gather that a pictureBox doesn't actually keep the alpha channel and that I need to store the info in memory and work on the data there, pre-multiplying the alpha channels and doing any other calculations I need to with the raw data and then display the result when all is done.
Unfortunately as a total noob I have no idea of how to do this.
My code so far:
Bitmap bitmap = new Bitmap(ImagePath + PBox1);
Bitmap layer = new Bitmap(ImagePath + PBox2);
for (int x = 0; x < layer.Width; x++)
{
for (int y = 0; y < layer.Height; y++)
{
Color BitmapPixel = bitmap.GetPixel(x, y);
Color LayerPixel = layer.GetPixel(x, y);
int r = (LayerPixel.A * (BitmapPixel.R - LayerPixel.R)) / 256 + LayerPixel.R;
int g = (LayerPixel.A * (BitmapPixel.G - LayerPixel.G)) / 256 + LayerPixel.G;
int b = (LayerPixel.A * (BitmapPixel.B - LayerPixel.B)) / 256 + LayerPixel.B;
Color newColor = Color.FromArgb(r, g, b);
bitmap.SetPixel(x, y, newColor);
}
progressBar1.PerformStep();
Update();
}
pictureBox3.Image = bitmap;
Basically what I want to do is take two images, both with an alpha layer in them. Overlay the second one onto the first one, using its alpha layer for transparency, and finally save out a new 32bpp image from the result.
Any help would be much appreciated.
Thankyou.
|
|
|
|
|
Doof369 wrote: I am having difficulty in keeping the alpha channels in my images when I open them into a c# pictureBox.
What did you expect the PictureBox to do?? It's only a "noobie" control used to quick'n'dirty show a single image. It doens't do any magical transformations on the image it's showing.
Doof369 wrote: I gather that a pictureBox doesn't actually keep the alpha channel
Yes it does, becuase it doesn't manipulate the Image object you passed to it in any way. Just because it doesn't show the results of the alpha channel, doesn't mean that it complete tossed it.
Doof369 wrote: I need to store the info in memory and work on the data there, pre-multiplying the alpha channels and doing any other calculations I need to with the raw data and then display the result when all is done.
That's exactly what you have to do. Check out the excellent series of articles Christian Grauss put together on image filters, here[^].
|
|
|
|
|
Doof369 wrote: Basically what I want to do is take two images, both with an alpha layer in them. Overlay the second one onto the first one, using its alpha layer for transparency, and finally save out a new 32bpp image from the result.
Just draw one image onto the other. Use Graphics.FromImage to create a Graphics object for one of the images, then use the DrawImage method to draw the other image on it.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks for the replies.
ok. So this is what I have now, which actually works ))
public static void ArgbOverlay(Bitmap bm2, Bitmap bm1, out Bitmap bm3)
{
int[,] a1 = new int[bm1.Width, bm1.Height];
int[,] a2 = new int[bm2.Width, bm2.Height];
int[,] a3 = new int[bm2.Width, bm2.Height];
int[,] r1 = new int[bm1.Width, bm1.Height];
int[,] r2 = new int[bm2.Width, bm2.Height];
int[,] r3 = new int[bm2.Width, bm2.Height];
int[,] g1 = new int[bm1.Width, bm1.Height];
int[,] g2 = new int[bm2.Width, bm2.Height];
int[,] g3 = new int[bm2.Width, bm2.Height];
int[,] b1 = new int[bm1.Width, bm1.Height];
int[,] b2 = new int[bm2.Width, bm2.Height];
int[,] b3 = new int[bm2.Width, bm2.Height];
Rectangle rect1 = new Rectangle(0, 0, bm1.Width, bm1.Height);
BitmapData bd1 = bm1.LockBits(rect1, ImageLockMode.ReadWrite, bm1.PixelFormat);
int bytes1 = bd1.Stride * bd1.Height;
byte[] argbValues1 = new byte[bytes1];
IntPtr ptr1 = bd1.Scan0;
Marshal.Copy(ptr1, argbValues1, 0, bytes1);
Rectangle rect2 = new Rectangle(0, 0, bm2.Width, bm2.Height);
BitmapData bd2 = bm2.LockBits(rect2, ImageLockMode.ReadWrite, bm2.PixelFormat);
int bytes2 = bd2.Stride * bd2.Height;
byte[] argbValues2 = new byte[bytes2];
IntPtr ptr2 = bd2.Scan0;
Marshal.Copy(ptr2, argbValues2, 0, bytes2);
bm3 = new Bitmap(bm1.Width, bm1.Height, PixelFormat.Format32bppArgb);
Rectangle rect3 = new Rectangle(0, 0, bm3.Width, bm3.Height);
BitmapData bd3 = bm3.LockBits(rect3, ImageLockMode.ReadWrite, bm3.PixelFormat);
int bytes3 = bd3.Stride * bd3.Height;
byte[] argbValues3 = new byte[bytes3];
for (int x = 0; x < bm1.Width; x++)
{
for (int y = 0; y < bm1.Height; y++)
{
int BitPos1 = (x * 4) + (y * bd1.Stride);
b1[x, y] = (int)argbValues1[BitPos1];
g1[x, y] = (int)argbValues1[BitPos1 + 1];
r1[x, y] = (int)argbValues1[BitPos1 + 2];
a1[x, y] = (int)argbValues1[BitPos1 + 3];
b2[x, y] = (int)argbValues2[BitPos1];
g2[x, y] = (int)argbValues2[BitPos1 + 1];
r2[x, y] = (int)argbValues2[BitPos1 + 2];
a2[x, y] = (int)argbValues2[BitPos1 + 3];
r3[x, y] = (r2[x, y] * a2[x, y]) / 256 + ((r1[x, y] * (256 - a2[x, y])) / 256);
g3[x, y] = (g2[x, y] * a2[x, y]) / 256 + ((g1[x, y] * (256 - a2[x, y])) / 256);
b3[x, y] = (b2[x, y] * a2[x, y]) / 256 + ((b1[x, y] * (256 - a2[x, y])) / 256);
if (a1[x, y] < a2[x, y])
{
a3[x, y] = a2[x, y];
}
else
{
a3[x, y] = a1[x, y];
}
argbValues3[BitPos1] = (byte)b3[x, y];
argbValues3[BitPos1 + 1] = (byte)g3[x, y];
argbValues3[BitPos1 + 2] = (byte)r3[x, y];
argbValues3[BitPos1 + 3] = (byte)a3[x, y];
}
}
IntPtr ptr3 = bd3.Scan0;
Marshal.Copy(argbValues3, 0, ptr3, bytes3);
bm3.UnlockBits(bd3);
return;
}
Was wondering if anyone can see any glaring ways to optimise this further to make it a less cumbersome piece of code and also to make it run faster if poss.
It is fine as it is, but less is more.
|
|
|
|
|
Who I Send data from textbox to datagridview in a diferent form?
Plesea give me the code.
Thanks.
|
|
|
|
|