Results 1 to 2 of 2

Thread: Using cCairoSurface drawing while preserving current image

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2017
    Posts
    761

    Question 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.

    Name:  c32bpp.png
Views: 31143
Size:  11.5 KB

    However, what I get when just using the .DrawToDC function of cCairoSurface, is that:

    Name:  1.png
Views: 384
Size:  9.9 KB

    Can you advise me on how to achieve my goal while being as performant as my previous approach c32bppdib approach?

  2. #2
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,454

    Re: Using cCairoSurface drawing while preserving current image

    Quote Originally Posted by tmighty2 View Post
    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.

    Name:  c32bpp.png
Views: 31143
Size:  11.5 KB

    However, what I get when just using the .DrawToDC function of cCairoSurface, is that:

    Name:  1.png
Views: 384
Size:  9.9 KB

    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width