戴高帽 ('to put a tall hat on someone') is the standard idiom for 'to flatter.' The image likely originates from imperial-era ceremonial caps that puffed up the wearer's height, putting one on someone metaphorically inflates their ego. During the Cultural Revolution, the literal sense returned: paper dunce caps labeling 'class enemies' were forced onto victims at struggle sessions.
usage
Synonym for the longer 高帽子 (gāomàozi). The verb pattern is 戴…(的)高帽 ('put a tall hat on…') for flattery, or 戴高帽 with no object for 'be flattered.'