FLTK logo

[fltk.general] Problem displaying recorded cairo image

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Problem displaying recorded cairo image david allen Oct 26, 2020  
  ## Background and Project Objective
I am developing a program for mathematical modeling. The program creates cairo images showing aspects of models fit to data. The bounding boxes of the images are not known in advance. Hence the image is written to an unbounded surface to be measured later. Code to setup a recording surface is

    cairo_surface_t* record =
        cairo_recording_surface_create(CAIRO_CONTENT_COLOR_ALPHA, NULL);
    cairo_t* cr = cairo_create(record);

The image code goes here.  The image is *measured* by

    cairo_rectangle_t rect;
    cairo_recording_surface_ink_extents(record,
                         &rect.x, &rect.y, &rect.width, &rect.height);

The surface can then be painted to any other type of surface. In my program, it is first shown on the screen and then, if satisfactory, exported to pdf.

## The Problem
I have attached a demo program. The recording phase and the export to pdf portions seem to work perfectly. The *display on screen* portion shows the image but with a corrupted background. I am using recent cairo and Linux Mint distributions. FLTK version is 1.4.0. I have not tried Mac or Windows. Hints for resolving this problem would be much appreciated.

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/bbf746b7-af22-4c52-8564-becfa93a41cfn%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.