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

bitsPerPixel gives wrong value

I'm confused about image resolution. In my project sizeof returns 4. It means that between one and the next pixel address is a 4 bytes. In other words i have RGBA format, 1 byte for each component? is it right? When i call CGImageGetBitsPerComponent…
user2032083
  • 313
  • 2
  • 4
  • 14
0
votes
1 answer

How to convert CGImageRef to base64 string

In my application, i am sending my desktop screenshot to web service by converting it to base64 string. Here is the code to obtain the screenshot. CGImageRef screenShot = CGWindowListCreateImage(CGRectInfinite, kCGWindowListOptionOnScreenOnly,…
santhosh
  • 1,191
  • 4
  • 14
  • 28
0
votes
0 answers

CGImageRef not releasing

I encountered a problem when using СП for (int16_t j = 0; j <= 1/kAlphaStep; j++) { UIImage *blendingImage = [UIImage imageByBlendingImage:firstImage andImage:secondImage alpha:kAlphaStep*j]; buffer = [self…
0
votes
0 answers

Cropping an iPhone camera photo in ios programmatically

I have the portrait version working fine as the scale is 0.75. But I cannot get the landscape to work correctly. I am using UIImagePickerController. // Landscape // Full landscape image is width: 3264 and height 2448 …
cdub
  • 24,555
  • 57
  • 174
  • 303
0
votes
1 answer

Saving and cropping a UIImage from the iphone camera

I have the following code: float photoWidth = photo.size.width; float photoHeight = photo.size.height; UIImage *picture = nil; if (photoWidth < photoHeight) { // Portrait // Scale the photo down CGRect…
cdub
  • 24,555
  • 57
  • 174
  • 303
0
votes
1 answer

CGBitmapContextCreateImage or CGContextDrawImage doesn't work

I can't solve this problem. Load image, convert to CGImageRef. Try to get bitmap context and render on the screen. NSURL *imageFileURL = [NSURL fileURLWithPath:stringIMG]; CGImageSourceRef imageSource =…
user2032083
  • 313
  • 2
  • 4
  • 14
0
votes
0 answers

Barcode image encoding works on simulator but not device

Im using ZXing framework to make an barcode image out of a string. When i try it on the simulator it work, but when I try it on a device, I get a bad access error ZXMultiFormatWriter *writer = [ZXMultiFormatWriter writer]; ZXBitMatrix* result =…
Yoav Schwartz
  • 2,017
  • 2
  • 23
  • 43
0
votes
1 answer

ios, can't get correct pixel color of CGImageRef

I made a context, then a gradient. After that I am drawing to the context. Then I receive an gradiented image from context and it is correct, I can see it in the debugger. But when I try to get a pixel color for a specific value it isn't correct. I…
Oleg
  • 1,027
  • 1
  • 8
  • 18
0
votes
1 answer

iOS: not getting correct result with CGBitmapContextCreate in method call

I have been scratching my head over this over hours. I am using the following method to resize 2 images. One after another: CGImageRef imageReference = [image CGImage]; bytes = malloc(width * height * 4); NSUInteger bytesPerPixel = 4; NSUInteger…
Unheilig
  • 16,196
  • 193
  • 68
  • 98
0
votes
1 answer

Cannot get the color of a pixel in this scenario

I've tried using the category solution described in this post (How to get the RGB values for a pixel on an image on the iphone). It doesn't seem to work in my scenario. In my scenario, I draw circles in response to a tap gesture: //mainImageView is…
Victor Engel
  • 2,037
  • 2
  • 25
  • 46
0
votes
1 answer

Extraction Video frames with Av foundation

i use this method to generate the frames of the video -(NSMutableArray *)generateThumbnailsFromUrl:(NSURL *)videoURl{ AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:videoURl options:nil]; Float64 durationFrames = CMTimeGetSeconds([asset…
Scorpioo.4
  • 45
  • 1
  • 10
0
votes
2 answers

Image filtering leads to high memory consumption and crash

I am using the following code for applying image filters. In my app I am filtering for brightness, contrast and saturation. I am using three separate sliders each to change the values. As I continue to move the values, the memory consumption goes…
Nassif
  • 1,113
  • 2
  • 14
  • 34
0
votes
0 answers

largeimagedownsizing giving destImageRef NULL and crashing ios

I am using Apple sample code to downsize the image. I tested for two images. One image is 204kB and other image is 205kB. It is crashing for 204kB image giving error as Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason:…
0
votes
1 answer

Objective-c undeclared identifier for CGImageDestinationRef

I have CoreGraphics, QuartzCore and AssetsLibrary frameworks imported. Why would I be getting an undeclared identifier error for CGImageDestinationRef? Here is how I am declaring it: CGImageDestinationRef imageDestinationRef =…
PruitIgoe
  • 6,166
  • 16
  • 70
  • 137
0
votes
1 answer

Issues with threading, blocks, CGImageRef and scope

I have a program where I set up a completion block that is running on a background thread. Inside the block I set up a CGImageRef and then on the main thread set my layer contents. THe problem is, sometimes the app crashes on the main thread…