Drawing NSString to UIImage

前端 未结 4 1722
梦毁少年i
梦毁少年i 2021-01-25 04:54

I have a NSString object. I want to write it to existing UIImage object. UIImage object already has some image associate with it. I want to write string to same image. How do i

4条回答
  •  醉梦人生
    2021-01-25 05:36

    EDIT: Following are basic step to achieve to edit an UIImage and write text on it.

    1. Get CGImage from UIImage.
    2. Render CGImage On context.
    3. Render Text you want to write on the same context.
    4. Get Bitmap of context and make CGImage out of that.
    5. Get UIImage from CGImage....

    It would be much easier to show text on and label and show that on image view. And answer for that are already there.

    Then Update it to file or show it on the screen....

提交回复
热议问题