1

Cairo provides read_from_png, but returns value of a special type CairoSurfaceBase, which is hard to operate, so I choose Matrix{RGB}(the thing ImageIO returns). Cairo does provide something called set_matrix, but the second argument must be of type CairoMatrix. There aren't any documents on this, so I can't figure out a way to convert between CairoMatrix and Matrix{RGB}. Or, more importantly, I want to show the Matrix{RGB}.

1 Answer 1

1
  1. convert the Matrix{RGB} to Matrix{T} T<:Union{ColorTypes.ARGB32, ColorTypes.RGB24}
  2. use CairoImageSurface to convert it to CairoSurface
  3. use set_source_surface to put the surface
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.