In this article, we will demonstrate a novel optical imaging device that can be directly integrated into a microfluidic network, and therefore enables on-chip imaging in a microfluidic system. This micro imaging device, termed optofluidic microscope (OFM) is potentially free of bulk optics and is based on a nanohole array defined in a nontransmissive metallic layer that is patterned onto the floor of the microfluidic channel. The operation of the optofluidic microscope will be explained in details and its performance is examined by using a popular animal model, Caenorhabditis elegans (C. elegans). Images from a large population of nematode worms are efficiently acquired within a short time frame. The quality of the OFM images of C. elegans and the morphological characteristics revealed therein are evaluated. Two groups of early-stage C elegans larvae, wild-type and dpy-24 are successfully separated even though their morphological difference at the larval stage is subtle. The experimental results support our claim that the methodology described therein can be effectively used to develop a powerful tool for fulfilling high-resolution, high-throughput imaging task in microfluidics-based systems.