2 Attachment(s)
Using cCairoSurface drawing while preserving current image
Hello!
I would like to draw a cCairoSurface image onto a DC while preserving what is there.
Here is an example of what that looked like when I used c32bppdib.
Attachment 192656
However, what I get when just using the .DrawToDC function of cCairoSurface, is that:
Attachment 192657
Can you advise me on how to achieve my goal while being as performant as my previous approach c32bppdib approach?
Re: Using cCairoSurface drawing while preserving current image
Quote:
Originally Posted by
tmighty2
I would like to draw a cCairoSurface image onto a DC while preserving what is there.
Here is an example of what that looked like when I used c32bppdib.
Attachment 192656
However, what I get when just using the .DrawToDC function of cCairoSurface, is that:
Attachment 192657
Can you advise me on how to achieve my goal while being as performant as my previous approach c32bppdib approach?
I think that kind of question was answered in different examples already...
The ideal Rendering-call for "Sub-Images" (Sub-Surfaces) is:
CC.RenderSurfaceContent SubSurface_Or_ImageListKey, OffsX, OffsY
Whereas the Surface.DrawToDC-call should be reserved for the "bigger Containers" -
like one or two PicBoxes on your Form - or ideally, the entire Form itself...
(and used as sparsely as possible).
That in turn means, you will have to create "Pixelsize-matching ParentSurface-CairoContext-Objects"
for these Containers first (to apply the above mentioned .RenderSurfaceContent to).
...BTW, you now have 3 questions already in the CodeBank-section -
(which is for code-examples and -demos).
Olaf