A General Approach for Fluid Patterning and Application in Fabricating Microdevices