Photovoltaic and light-Emitting Devices Using Photonic Crystals