uiimage

Retrieve an image from Firebase to an UIimage swift5

本小妞迷上赌 提交于 2021-02-05 09:34:06
问题 I'm struggling to download pictures from firebase storage to an UIImage in swift 5. I can well upload them. When I tried to retrieve picture, the UIImage display a black screen. here my function which return the UIImage import UIKit import Firebase func getImageEvent (imagePath : String) -> UIImage? { var myImage : UIImageView? //Access to the storage let storageRef = Storage.storage().reference(withPath: imagePath) storageRef.getData(maxSize: 1 * 1024 * 1024) {(data, error) in if let error =

Is it possible to tag a uiimage in uiimageview individually?

最后都变了- 提交于 2021-01-29 21:47:29
问题 I searched in the class reference of UIImageView and UIImage, but did not find any info on tagging. In my code, I tagged all of the images in my NSMutableArray of images for my UIImageView, so I could retrieve the tag later: [[images objectAtIndex:0] setTag:1]; [[images objectAtIndex:1] setTag:2]; [[images objectAtIndex:2] setTag:3]; ... This causes my application to crash when I run it. The output reads: 2013-08-08 11:26:48.596 Tap Me[8145:c07] -[UIImage setTag:]: unrecognized selector sent

Is it possible to tag a uiimage in uiimageview individually?

此生再无相见时 提交于 2021-01-29 20:11:48
问题 I searched in the class reference of UIImageView and UIImage, but did not find any info on tagging. In my code, I tagged all of the images in my NSMutableArray of images for my UIImageView, so I could retrieve the tag later: [[images objectAtIndex:0] setTag:1]; [[images objectAtIndex:1] setTag:2]; [[images objectAtIndex:2] setTag:3]; ... This causes my application to crash when I run it. The output reads: 2013-08-08 11:26:48.596 Tap Me[8145:c07] -[UIImage setTag:]: unrecognized selector sent

how to convert image in a byte[] array to Xamarin.IOS UIImage control

十年热恋 提交于 2021-01-29 08:08:02
问题 My Xamarin.IOS app gets build error: "cannot convert type byte[] to UIKit.UIImage" My code: ImageView_camera.Image = Camera_Socket_Client.packet_frame_state.buffer; The buffer contains a frame sent by socket from a UWP Windows app, which got the frame from a USB camera from a Logitech HD 1080p webcam. I want to show live image from webcam at IPAD. 回答1: UIImage.LoadFromData(NSData.FromArray(myByteArray)); 来源: https://stackoverflow.com/questions/53890842/how-to-convert-image-in-a-byte-array-to

Export SKTexture to a UIImage with alpha channel

天大地大妈咪最大 提交于 2021-01-28 19:43:44
问题 I would like to be able to export my SKTexture to an external image file. I have been able to achieve this using the following code. However it suffers from the critical flaw that the alpha channel is ignored even thoough the view is not opaque and all background colours are set to clear. - (void)export:(CGRect)bounds texture:(SKTexture *)texture path:(NSString *)path{ UIGraphicsBeginImageContextWithOptions(bounds.size, NO, [UIScreen mainScreen].scale); SKView *view = [[SKView alloc]

UIImageJPEGRepresentation and UIImagePNGRepresentation returns nil in iOS 13

馋奶兔 提交于 2021-01-28 07:31:47
问题 In my app I'm using the image picker to select an image on an iPhone. After the image was selected, I do: data = UIImageJPEGRepresentation(image, 1.0); On iOS 12.4.1 and below, everything works fine, if I pick either PNG or JPEG image. On iOS 13, JPG works fine, but PNG does not. If I pick a JPG: data = UIImageJPEGRepresentation(image, 1.0); // works data = UIImagePNGRepresentation(image); // works But if I pick a PNG: data = UIImageJPEGRepresentation(image, 1.0); // data is nil data =

UIImageJPEGRepresentation and UIImagePNGRepresentation returns nil in iOS 13

拈花ヽ惹草 提交于 2021-01-28 07:21:36
问题 In my app I'm using the image picker to select an image on an iPhone. After the image was selected, I do: data = UIImageJPEGRepresentation(image, 1.0); On iOS 12.4.1 and below, everything works fine, if I pick either PNG or JPEG image. On iOS 13, JPG works fine, but PNG does not. If I pick a JPG: data = UIImageJPEGRepresentation(image, 1.0); // works data = UIImagePNGRepresentation(image); // works But if I pick a PNG: data = UIImageJPEGRepresentation(image, 1.0); // data is nil data =

UIView drawHierarchy creating a black image

回眸只為那壹抹淺笑 提交于 2021-01-28 00:55:55
问题 I am trying to convert my custom UIView into UIImage using core graphic, but sometimes it turns to black, my whole UIImage looks like a black image. What I noticed is that if the height of my UIView is exceeding 4096 regardless what the width is then the produced UIImage will be black! Note 1: my custom UIView is loaded from a nib file. Here is my code: func getImageWithScale(_ scale: CGFloat) -> UIImage { let size = self.bounds.size.applying(CGAffineTransform(scaleX: scale, y: scale))

How to save SKSpriteNode as PNG image to Camera Roll?

非 Y 不嫁゛ 提交于 2021-01-27 20:38:25
问题 I'm trying to convert SKSpriteNode as a PNG image with transparency to Camera Roll. This saves the image but not with transparency: let image = UIImage(cgImage: (spriteNode.texture?.cgImage())!) UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil) This complains: Cannot convert value of type 'Data?' to expected argument type 'UIImage' let image = UIImage(cgImage: (createdCloudShadow.texture?.cgImage())!) let image2 = UIImagePNGRepresentation(image) UIImageWriteToSavedPhotosAlbum(image2, nil,

Resize UIImage for UIPrintInteractionController

∥☆過路亽.° 提交于 2021-01-27 06:59:34
问题 I'm currently working on a possibility to print the content of a view via Airprint. For this feature I'm creating a UIImage from the view and send it to UIPrintInteractionController. The problem is that the image is resized to the full resolution of the paper and not it's original size (approx. 300x500px). Does anybody know how to create a proper page from my image. Here is the code: /** Create UIImage from UIScrollView**/ -(UIImage*)printScreen{ UIImage* img = nil;