Catalyzes the biosynthesis of pterostilbene from resveratrol. Pterostilbene has both antifungal and pharmacological properties. Also has activity toward resveratrol monomethyl ether (RME). 2 S-adenosyl-L-methionine + trans-resveratrol = 2 H(+) + pterostilbene + 2 S-adenosyl-L-homocysteine Expression in leaves is induced by different stresses, such as downy mildew (P.viticola) infection, ultraviolet light, and AlCl(3) treatment. Belongs to the class I-like SAM-binding methyltransferase superfamily. Cation-independent O-methyltransferase family. COMT subfamily.