Asked by Zoltán Csáti
on 15 Sep 2013

I wrote a GUI application but my problem is that when I save the figure programatically using the saveas command, colors of the uicontrol objects seem to be inverted. The MATLAB Documentation says that inversion only applies to figures, not uicontrols. But here it is not the case. Does anybody have an idea?

Thanks,

Zoli

Related Content

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today
## 9 Comments

## Walter Roberson (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/87272-matlab-inverts-colors-in-uicontrol-objects#comment_169101

What kind of format are you saving the object as?

If you are looking at the figure InvertHardcopy property, note that it says,

which is more than just "figures". uicontrols are potentially covered under the "etc."

## Zoltán Csáti (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/87272-matlab-inverts-colors-in-uicontrol-objects#comment_169105

But I did this:

and it still inverts.

## Walter Roberson (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/87272-matlab-inverts-colors-in-uicontrol-objects#comment_169106

Please show your saveas() command.

## Zoltán Csáti (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/87272-matlab-inverts-colors-in-uicontrol-objects#comment_169266

It is my function that uses the saveas command. Before it, I set the 'InvertHardCopy' property to 'off', as you can see in my previous comment.

## Walter Roberson (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/87272-matlab-inverts-colors-in-uicontrol-objects#comment_169267

As a test, at the command line command

Then try again. When you finish, set() the value back to whatever came out in IHC

## Zoltán Csáti (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/87272-matlab-inverts-colors-in-uicontrol-objects#comment_169275

Command

displays 'on', but using

creates an error: "Bad property value found".

## Sean de Wolski (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/87272-matlab-inverts-colors-in-uicontrol-objects#comment_169277

should be 'off' instead of 'false'

## Walter Roberson (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/87272-matlab-inverts-colors-in-uicontrol-objects#comment_169278

Sorry try 'off' instead of 'false'

## Zoltán Csáti (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/87272-matlab-inverts-colors-in-uicontrol-objects#comment_169281

I tried it but failed. I mean the colour of the uicontrol objects were converted to light green instead of grey. Could you please try my saveAs function on your machine with a custom figure with a pushbutton on it? Perhaps you will exactly know what I'm thinking of. Thank you for your help so far.