*.bmp file writing in to sdcard

Hi

I am using arduino lenardo board for my development

I want to write a *.bmp file in to SD card . Please let me know any functions call for this.
I tried with example code available in arduino example library(file read write).

I used write() function , but the written file format could not recognized.

is there any binary read write functions available in arduino library which is compatible with arduino leonardo.

Thanks

hello-a