Re: How to determine total size of group of images
- From: Damon Chaplin <damonachaplin gmail com>
- To: Fred van Zwieten <fvzwieten gmail com>
- Cc: goocanvas-list <goocanvas-list gnome org>
- Subject: Re: How to determine total size of group of images
- Date: Wed, 23 Aug 2017 11:35:21 +0100
On Tue, 2017-08-22 at 22:07 +0200, Fred van Zwieten wrote:
Hi,
I am experimenting with GooCanvas in pygobject.
I want to be able to do operations on a selection of images on a
canvas. I want to draw a border around the group of images with
handles for resizing, scaling and rotating (a bit like libreoffice
draw does that, or Google Diagram).
I am having some difficulty on how to do this. When I add the images
to a CanvasGroup I can operate resizing, scaling and rotating on the
group as a whole. However, to be able to draw a border around the
group of images, I need to know the total size of the group. I was
hoping the height en width properties of the CanvasGrop would provide
for them automagically, but they stay on -1.0.
Is there an easy way to get the x, y, height, width of the images
within the group.
There is a goo_canvas_item_get_bounds() function, which should also work
on groups, I think.
Otherwise you'll have to iterate over the items in the group with
goo_canvas_item_get_child() and combine the x/y/width/height or bounds.
Damon
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]