Monte Carlo simulations are commonly used in elemental quantification using energy-dispersive spectroscopy (EDS). Here, the Monte Carlo program MC X-ray was incorporated into the image processing software Dragonfly by Object Research Systems (ORS) as a simulation library. The simulation program has been transformed into a complete microscope simulator where the tools of Dragonfly allow complex voxel-based geometries to be constructed, and the electron beam and detectors can be freely placed inside the 3D space. Computation times of simulations have been improved drastically through new data structures and parallelization. Simulations of backscattered electron imaging and EDS mapping are presented here to demonstrate the capabilities of this new library.