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
2
votes
2 answers

view.layer drawInContext:UIGraphicsGetCurrentContext() not drawing

I am trying to draw a UIView into a UIImage. Here is the code that I'm using: UIGraphicsBeginImageContextWithOptions(myView.bounds.size, YES, 0.f); [myView.layer drawInContext:UIGraphicsGetCurrentContext()]; UIImage *img =…
Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
2
votes
2 answers

CGImageRef consumes lot of memory

I am creating blur image for one of my apps screen, for this i am using following code UIGraphicsBeginImageContext(self.view.bounds.size); [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *image =…
Shankar BS
  • 8,394
  • 6
  • 41
  • 53
2
votes
1 answer

Problems with NSArray of CGImageRef's (but not on simulator!)

I am trying to put a few CGImageRefs into an NSArray. It works as it should on the simulator, but not on the device - it crashes at the point where I try to form the array with a EXC_BAD_ACCESS code = 1 error. I tried other things too, like starting…
Gusutafu
  • 745
  • 6
  • 17
1
vote
2 answers

CGImageCreate Test Pattern is not working (iOS)

I'm trying to create an UIImage test pattern for an iOS 5.1 device. The target UIImageView is 320x240 in size, but I was trying to create a 160x120 UIImage test pattern (future, non-test pattern images will be this size). I wanted the top half of…
GrandAdmiral
  • 1,348
  • 2
  • 24
  • 52
1
vote
1 answer

CGPoint inside CGImageRef

Can I know if a CGPoint is inside a CGImageRef? Or I should convert CGImageRef in other format? UPDATE maskcontext = CGBitmapContextCreate(currentM, w, h, …
cyclingIsBetter
  • 17,447
  • 50
  • 156
  • 241
1
vote
1 answer

CFDataRef and Pixel Data for iPhone Programming

I am trying to access the raw pixels of an image, but I keep running into a problem that got me really stuck. I am pretty new to iPhone programming so it might be something really simple... Here is the class I have, it uses a CGImageRef from an…
samuelschaefer
  • 614
  • 2
  • 10
  • 26
1
vote
3 answers

Crop a UIImage to use with GLKTextureLoader

I am trying to crop an area out of a UIImage to use with GLKTextureLoader. I can set the texture directly using the the UIImage with the following: - (void)setTextureImage:(UIImage *)image { NSError *error; texture = [GLKTextureLoader…
LZNPDE
  • 164
  • 2
  • 8
1
vote
0 answers

How to get Quality image using CGBitmapContextCreateImage

How?... I am tring to get High Quality image using CGBitmapContextCreateImage() and tried to do it with the following code. - (CGImageRef) imageForPageIndex:(NSUInteger)pageIndex { NSUInteger width = pageSize.width; NSUInteger height =…
jinbruce627
  • 133
  • 8
1
vote
1 answer

iphone UIImage resize by endpoints

I want resize the shapes draw on context by picking their endpoints. And also rotate it with its endPoints. Can anybody suggest me how can I do this with proper example? My edited Question. According to the image I have to rotate and scale the…
Jane
  • 288
  • 1
  • 3
  • 18
1
vote
2 answers

Does UIView .layer CALayer begin with a layer?

For a little project to become a more optimized efficient programmer for the upcoming iPhone game I'm making, I'm trying to make a user interactive interface, but it's difficult. In my last question posted yesterday I asked about improving my…
Crosility
  • 111
  • 1
  • 7
1
vote
1 answer

How to unload iPhone images to free up memory

I have an iPhone game that uses images to display things such as buttons on screen to control the game. The images aren't huge, but I want to load them "lazily" and unload them from memory when they are not being used. I have a function that loads…
Sam
  • 13
  • 2
1
vote
0 answers

CGImageRef: How to get sharper image when zooming in?

I'm need to draw a CGImageRef on a PDF-page that is zoomable. Everything looks fine as long as it's zoomed out. But as soon as I zoom in, of course it gets all blurry. Is there any way increase the quality of the zoomed image? Here is my…
kolt siewerts
  • 41
  • 1
  • 3
1
vote
0 answers

How do I return a CGImageRef from CGWindowListCreateImage to C#?

I'm currently attempting to write a plugin for macOS for Unity. I am taking a screenshot of the desktop with CGWindowListCreateImage. I'm trying to figure out how to return the byte[] data to C# so I can create a Texture2D from it. Any help would be…
Evan
  • 11
  • 1
1
vote
0 answers

iOS CGImage leak

I used Instruments Leak, and found something.In my project, I do some stitching job.Then resave with photo's exif. But I don't know where leaks?
ChokWah
  • 105
  • 8
1
vote
0 answers

Why AVAssetImageGenerator generateCGImagesAsynchronouslyForTimes crashes the app

I am trying to extract 2 frames per second from a video using generateCGImagesAsynchronouslyForTimes. But my app crashes. I am monitoring the memory usage but its not going any way up than 14 mb. Here is the code: - (void)…
nr5
  • 4,228
  • 8
  • 42
  • 82