开发者

Can a UILabel be part of a created image?

开发者 https://www.devze.com 2023-03-24 04:35 出处:网络
I have a project where I let the user draw on the screen of the iPhone (signature box).It works great... prints to a specific label printer (Zebra gx420d).My question is as follows:Can I have a UILabe

I have a project where I let the user draw on the screen of the iPhone (signature box). It works great... prints to a specific label printer (Zebra gx420d). My question is as follows: Can I have a UILabel field be part of the "Image" that is drawn? It is visi开发者_JAVA百科ble on screen, but doesn't print.

Any help would be appreciated!


Just make sure the label and your custom view subclass that draws the signature are both subviews of a common superview. Then invoke print on the common superview, and both of them (actually all subviews) will be part of the printed image.


You need to draw the text into an image graphics context.

This question may help: How do I use the NSString draw functionality to create a UIImage from text

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号