Available in the LEADTOOLS Imaging toolkit.
CenterImage example for Visual Basic
'toggle CenterImage LEAD1.CenterImage = Not LEAD1.CenterImage