2015-02-20 23:56 GMT+01:00 Sean P. DeNigris <[hidden email]>:I'm implementing a SimpleImageMorph which squeezes the form into the Morph's
inner bounds instead of the weird TransformMorph thing.
As a spike, I wrote:
| transform scale |
scale := self innerBounds width / self image width.
transform := MorphicTransform new setScale: scale.
aCanvas warpImage: self image transform: transform at: self innerBounds
origin
But obviously this only takes the width into account. How would I transform
both of the forms dimensions to the corresponding dimension of the morph's
inner bounds?
I think there is no direct support in Canvas API.You can
create a new Formwarpblt into this formuse the canvas to draw the new form
|f|
f:=Form extent:100@400 depth:32.
(WarpBlt current toForm: f)
sourceForm: PolymorphSystemSettings pharoLogoForm destRect: f boundingBox;
combinationRule: Form paint; cellSize:2; warpBits.
f asMorph openInHand
-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/Canvas-Transform-Width-and-Height-Independently-tp4806749.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Free forum by Nabble | Edit this page |