RMShapedImageview
- 2. 自己紹介
平野百貨店
平野 哲也
@hiranodept
こんなアプリ作りました。
Happynote EverShaker Simple Routine パズタス きょうのネコ
※MORE6月号(4月27日発売)コラム「トレンド★パパラッチ」で紹介してくれるらしい
13年4月5日金曜日
- 3. RMShapedImageView
画像の透過部分を無視するUIImageViewのサブクラス
RMShapedImageView (Apache License ver2.0)
https://github.com/robotmedia/RMShapedImageView
13年4月5日金曜日
- 9. RMShapedImageView
ポイント
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
この中で、タッチポイントのピクセルが
アルファ値が0かどうか判定している
また、1ピクセルを取り出して判定しているので
その判定を緩くするオプション shapedPixelTolerance もあるみたい。
このプロパティに入れた数値分、周辺のピクセルもテストしてくる。
多分、パフォーマンスに影響でるかと。
13年4月5日金曜日
- 10. RMShapedImageView
使い方
お使いのプロジェクトに
RMShapedImageView.hと.mを入れる
あとは、
UIImageViewだったオブジェクトを
RMShapedImageViewにリネームするだけ
13年4月5日金曜日
- 11. RMShapedImageView
IBでの注意点
ModeがCenterになっているので、ScaleToFillに
※ハマりどころ
UIImageViewをRMShapedImageViewにする
13年4月5日金曜日
- 13. RMShapedImageView
RMShapedImageView (Apache License ver2.0)
https://github.com/robotmedia/RMShapedImageView
元ネタ
Detect touches only on non-transparent pixels of UIImageView,
efficiently
http://stackoverflow.com/questions/13291919/detect-touches-
only-on-non-transparent-pixels-of-uiimageview-efficiently
13年4月5日金曜日