getframe() cdata does not match data assigned

1 view (last 30 days)
I am trying to develop a tool that allows me to quickly evaluate the colors visible in a view frame. Suppose that I am creating two triangle, assigning colors to them and then plotting it using trisurf3D that uses patch. I now want to take a screenshot and then compare the cdata with the colors I assigned.
I am doing it two different ways. 1) I save the figure as png using print, read it using imread and get the data. This was the rgb data of the read file matches the colors i assigned however is too slow because of the writing and reading process. 2) I am trying to do this on the fly using getframe and then using .cdata approach. However, in this case the colors read do not match the ones I assigned.
Is there another way of doing this on the fly?

Answers (0)

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!