I had a bad right knee before surgery. The pain was so bad I was having to use a cane at home. I just limped at work. I couldn't walk far without pain. I took my grandsons to an amusement park and had to take my cane and stop and rest every 100 feet or so.
I had a steroid shot that made my knee feel like new for about 4-5 weeks. Then we went for the gel, a series of three shots. It worked great for a few months. I had the RNY surgery December 2011 starting at 263 pounds. My knee didn't feel significantly better until I got down below 200. I walked/ran my first 5K July 1. I am now 157 lbs and my knee is 90% better. I still have some discomfort when I get up after sitting a long time but am able to walk that out quickly.
I also found that a knee brace ($10-12 at Walgreens) helped when weight bearing before my weight loss. My doctor cleared me for all exercise except leg extensions. Do what you can tolerate to work the knees so you can strengthen the muscles surrounding them. It makes a big difference.
As the weight comes off, your knee will not have as much pressure. I've heard that with every five pounds there is 25 lbs of pressure on the knee.
Good luck to you!