Serial camera output

i have a simple code :

 byte[] data = serCam.dataImage;
 string name = "img.bmp";
 sdCard.GetStorageDevice().WriteFile(name, data);

the img.bmp file will be saved on sd card in 13Kb, but usually I receive error about damaged file "windows ca not open the file , it is damaged or …"
can eanybody help me?

Please see the note about flush all here

maybe you have to test the [quote]isNewImageReady[/quote] property

thanks for answers
It seems that the problem is not about writing byte array on sd card.
the property of :

always return FALSE !!!!
apart from that, I've read this note :
but i don't have this methods :


Is it in a new version of .net micro framework?

sorry for mistake, It is the mentioned code :

the name of the file is wrong? It should begin with \SD… ?

Thanks very much for your attentions…
I’m using net micro framework sdk 4.2
Is that method just for sdk ver 4.3?
Mike : I’'m writing the file on sd and I can see it when I connect sd to my pc. Ut when i want to open it, I recieve that error

@ andre.m -

I’ve installed sdk ver 4.3, but, I can’t still see that method…

@ VB-Daniel -
That method always return false!!!