[cairo] A newbie question on surfaces
Anurag Singh
anurag12singh at gmail.com
Wed Oct 17 22:37:03 PDT 2007
On 10/17/07, Carl Worth <cworth at cworth.org> wrote:
> On Tue, 16 Oct 2007 20:17:36 +0530, "Anurag Singh" wrote:
> > My question is that can I get the cairo surface from the cairo context I
> > am getting using cairo_get_target() even if the cairo context which I
> > get was created using gdk_cairo_create().
>
> The cairo_get_target function should always "work". It's possible that
> using it with gdk_cairo_create might not do what you want, since GTK+
> creates transient cairo surfaces for double-buffering, and that's the
> surface that will be returned by cairo_get_target after
> gdk_cairo_create.
>
> But as long as you understand the implications of that, then you
> should be fine.
>
I guess I should have studied the archives before posting my query.
Basically, I wanted to have the width and the height of the 'surface'
which is returned by cairo_get_target() on a cairo_t created using
gdk_cairo_create(). I read the archives and found out that somewhere
around June'06 the same question had cropped up.
Anyway, since there is no cairo method by which I can get the width
and height of the 'surface' returned, can somebody guide me as to how
I can get the same using some other roundabout way.
One solution as suggested by Thomas is to use allocation.width. I'll try that.
Basically what I am doing is to create a mini map sort of a thing. So
if a user presses some key I should create another widget and scale
down the page according to the size of the new widget created. That is
why Iw ant to know the height and the width of the surface returned.
> > My apologioes if the question is a bit unclear.
>
> If I missed the intent of the question, feel free to try again with
> more detail.
>
> -Carl
>
>
--
Anurag Singh
Stat Rosa Pristina Nomine,Nomina Nuda Tenemus.
More information about the cairo
mailing list