Since time immemorial, iOS developers have been perplexed by a singular question: “How do you resize an image?”It’s a question of beguiling clarity, spurred on by a mutual mistrust of developer and platform. Myriad code samples litter Stack Overflow, each claiming to be the One True Solution™ — all others, mere pretenders. In this week’s article, we’ll look at 5 distincttechniques to image resiz

はじめに モバイルアプリサービス部の中安です。 アプリを作ってきた際に、あるとなかなか便利だったextensionをボチボチとご紹介していければと思っています。 アプリの目的に合わせてやりかえる必要があったり、もっとよい実装があるかもしれませんが、何かの役に立てば光栄です。 今回はUIImage 編です。 コンテキスト描画のラップ 画像を加工する際の常套手段として、グラフィックコンテキストに描画してUIImageを取得する方法があると思います。 文章では分かりづらいので、ソースコードで書くと // コンテキストを開始 let size =CGSize(width: 100, height: 100)UIGraphicsBeginImageContext(size) // コンテキストを取得 let context =UIGraphicsGetCurrentContext()! (何
![[Swift] あると便利だったextension達 UIImage編 | DevelopersIO](/image.pl?url=https%3a%2f%2fcdn-ak-scissors.b.st-hatena.com%2fimage%2fsquare%2fd9c911035d6b7c1c0afb32d4e1e6f2e752169d3a%2fheight%3d288%3bversion%3d1%3bwidth%3d512%2fhttps%253A%252F%252Fdevio2023-media.developers.io%252Fwp-content%252Fuploads%252F2018%252F12%252Feyecatch-swift.png&f=jpg&w=240)
1リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く