Skip to content

Easier transforming of images #120

Open
@trych

Description

@trych

At the moment to transform an image b.transformImage(img, x, y, width, height) has to be used. All the b.itemX, b.itemWidth and so on commands cannot be used as setters, as only the frame will be transformed, not the image itself.

If I for example want to scale an image in place, I will have to get all four values just to do that: x, y, width, height. Same thing, if I want to move it to another position without scaling, I still have to get width and height first.

To make working with this easier we could either

1. Introduce methods like b.imageX(), b.imageY() and so on. Or simpler b.translateImage() and b.scaleImage() etc.

OR

2. (which I think would be better) Modify the behavior of b.itemX(), b.itemWidth() that they set the x, width etc. for both the image frame and it's contained graphic. In this scenario we would need to introduce a method to get the contained graphic somehow, in case this should be transformed by itself (which is a method I wanted to suggest anyways, as it can be very useful). So something like b.graphic(myImageFrame). This solution would keep everything clean in the sense that b.itemWidth() and b.itemSize() and so on can be used consistently for any item.

Thoughts?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions