Microdroplets and microbeads were produced with nanometer size precision by observing the optical resonances and used as optical barcodes.