The title is "Officer of the Staff in Bajo" Bajo in spanish is under, or beneath and as the facing of the jacket is black I would presume that the officer is in un-dress, as in he is wearing a non-uniform or dinner jacket.
Wiith the Bicorn and spanish wording, this would have been a painting from the Peninsular War and the blue finish on the numbner/horse blanket would suggest the Household Division but he is carrying an infantry sword so it would not be an Officer from a Cavalry Regiment, although it is slung in cavalry style. The plume in the bicorn also denotes a Line Company.
To sum, a Household or Guards officer of a line company, from the Peninsular period, in a dinner jacket, riding casually.
Just a guess.