I want to draw a moving sine wave with variable frequency and variable amplitude in a crisp and anti-aliased way. How is this possible?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well, I implemented sine wave into the UIView drawrect method as follows :
Here x would be the width of each sine wave, while y is the height of the frame. This would draw number of sine waves to fit in the whole UIViewFrame. It would produce crisp looking sine wave and yc being control handle. Try it you might like it.
If the width ie. x is similar to the width of the frame then a single sine wave will be produced.
Number of complete sine wave = (width of frame) / (‘x’ width of each sine wave)