Questions tagged [cgimageref]

The CGImageRef opaque type represents bitmap images and bitmap image masks, based on sample data supplied. This is part of the Core Graphics framework.

The CGImageRef opaque type represents bitmap images and bitmap image masks, based on sample data supplied. A bitmap (or sampled) image is a rectangular array of pixels, with each pixel representing a single sample or data point in a source image. This is part of the Core Graphics framework.

See and as well.

151 questions
0
votes
0 answers

Terminated due to memory issue

I'm try to scale an image in UIImageView i try to call this below code getting an error Memory leak. please any one help me. UIImage *imagess; CGFloat scale = [self.slider value]; CIImage *ciimage = [CIImage imageWithCGImage:image.CGImage]; …
Thobio
  • 57
  • 2
  • 7
0
votes
0 answers

CGContextDrawImage thread safe?

I have a context that needs to be around for the life of my app because it is a buffer that I continuously render images into. It is created using CGBitmapContextCreate on my main thread when the app launches. Is it safe to later call the following…
Trygve
  • 1,317
  • 10
  • 27
0
votes
0 answers

Creating screenshots on macOS Mojave without missing regions

I have some code to create screenshots. On High Sierra it worked without issues. However, it does not work anymore properly since I run it on Mojave. Some parts are cut out. I use this API call: CGImageRef screenshot =…
tr4px
  • 29
  • 1
  • 5
0
votes
0 answers

CGImage from Swift to Objective C

I got following troubling problem: I want to transfer a CGImage from Swift into Objective C. It just doesn't work That's the call func transferImage(cgImage: CGImage) { objcobject.cgimage = cgImage } That's the objc header: @property (nonatomic,…
Martina
  • 11
0
votes
2 answers

CGImageCreateWithImageInRect

I am trying to create a simple cropping app. I have a view overlayed on a UIImage and I want to crop a new image out of only the part of the UIImage where the view is overlayed. I used the code CGRect cropRect = _cropView.frame; UIImage *cropImage =…
cvrattos
  • 51
  • 1
  • 4
0
votes
0 answers

UIImage Size Property Returning Pixel Dimensions Instead of Points

I'm taking a CVImageBufferRef from the camera output, then converting it to a CGImageRef with VideoToolbox, then converting that to a UIImage. Weird thing is.... when I check the size of the UIImage, it's printing out the pixel width NOT the point…
Gukki5
  • 497
  • 6
  • 22
0
votes
2 answers

How do you set kCGImagePropertyExifUserComment on a CGImageMetadataRef?

How do you set kCGImagePropertyExifUserComment on a CGImageMetadataRef in iOS? These are the only functions I have found and they are only for…
Nick Wilkerson
  • 353
  • 2
  • 17
0
votes
0 answers

CGImage memory size returning weird results

I'll make it quick and straightforward. I'm using this method to calculate 'UIImage' memory size. extension UIImage { func memorySize() -> size_t { let image = self.cgImage! let size = image.height * image.bytesPerRow …
Roi Mulia
  • 5,626
  • 11
  • 54
  • 105
0
votes
0 answers

EXC_BAD_ACCESS when modifying data returned by CFDataGetBytePtr

Making long story short, I want to capture a window and then modify the bytes buffer: struct CaptureObject { unsigned char* bgraData; CFDataRef bgraDataRef; CGDataProviderRef provider; int width; int…
Sanich
  • 1,739
  • 6
  • 25
  • 43
0
votes
1 answer

When creating a CGImage with a decode array, the output has all of it's pixels offset by a small amount

Very weird behavior, but I have narrowed the problem down as far as I can go I think I have a NSImage, let's call it inputImage. It is represented by a NSBitmapImageRep in a CGColorSpaceCreateDeviceGray, if that matters I want to create a…
A O
  • 5,516
  • 3
  • 33
  • 68
0
votes
0 answers

Converting NSImage to CGImageRef on double monitor setup

So, we have a NSimage that's cropped and resized according to user input. It's working fine on both retina and non-retina Macs. Problem is, when I connect a non-retina screen to my retina macbook, it started to double the size of the images. The…
Paulo Cesar
  • 2,250
  • 1
  • 25
  • 35
0
votes
1 answer

Bad receiver type 'CGImageRef' (aka 'CGImage *')

I am an iOS beginner and was following How can I manipulate the pixel values in a CGImageRef in Xcode to learn altering CGImages. I changed the code a little so that the middle pixel in the image should get painted red instead of swapping blue and…
seko
  • 47
  • 5
0
votes
2 answers

CGImageRef not init/alloc correctly

I am currently having problems with CGImageRef. Whenever I create a CGImageRef and look at it in debugger view, in Xcode, it is nil. Here's the code: -(void)mouseMoved:(NSEvent *)theEvent{ if (self.shoulddrag) { NSPoint event_location =…
Pro Blaster
  • 491
  • 3
  • 9
0
votes
1 answer

UIImage Not Splitting Properly

I am trying to split a UIImage in half horizontally, keeping the original width of the image, but the returned image is the top left corner of the original. CGImageRef imageRef = image.CGImage; CGImageRef topR =…
Peter
  • 1,053
  • 13
  • 29
0
votes
1 answer

sending CGImageRef as an output parameter

I need to get a capture of a moving window. Because the window is moving I want to capture it in the main thread: void MacRenderer::captureImageImpl(const CGRect& captureRect, const CGWindowID windowId, CGImageRef* img) { *img =…
Sanich
  • 1,739
  • 6
  • 25
  • 43