In this work, we present a novel optical imaging device that can be directly integrated into a microfluidic network, and can therefore enable on-chip imaging in a microfluidic system. This micro imaging device, termed optofluidic microscope (OFM) is free of bulk optics and is based on a nanohole array defined in a non-transmissive metallic layer that is patterned onto the floor of the microfluidic channel. The operation of the optofluidic microscope is explained in details and its performance is examined with Caenorhabditis elegans (C. elegans) of various genotypes. Images from a large population of worms are efficiently acquired within a short time frame. The quality of the OFM images of C elegans and the morphological characteristics revealed by the images are evaluated. The experimental results support our claim that the methodology described therein can be effective in a powerful tool for fulfilling high-resolution, high-throughput imaging task of the microscopic biological samples.