Macleay was born in Oban on the west coast of Scotland. The son of a surgeon, he was already producing competent miniatures on ivory when he entered the Trustees' Academy in Edinburgh in 1822. Within a year he had set up in business as a portrait painter and by 1830 he was the leading miniaturist in Scotland. Working in watercolour, he expanded his range, partly in reaction to the impact of photography on the miniature business, to include larger 'cabinet' size portraits. These were highly successful and in 1865 Queen Victoria commissioned series of these depicting her favourite servants at Balmoral. The project took four years and the portraits, which were published in 1870, remain Macleay's best known work.