I have successfully use directshow to preview and record an image from webcam, but the problem is when I used the application in the tablet, the orientation is not the same as w
DirectShow API does not have built in capabilities to rotate video. It is assumed that if you need rotation then an external (third party) transformation filter is inserted into pipeline and perform a transform.
Discussed many times, see: