Questions tagged [cgbitmapcontext]

35 questions
34
votes
8 answers

I am getting unsupported parameter combination CGBitmap error with swift

I am trying to create a CGContext in swift. It compiles but throws an error at runtime. let colorSpace:CGColorSpace = CGColorSpaceCreateDeviceRGB() let context:CGContext = CGBitmapContextCreate(nil, 20, 20, 8, 0, colorSpace,…
loopmasta
  • 1,693
  • 3
  • 14
  • 19
13
votes
3 answers

Handle large images in iOS

I want to allow the user to select a photo, without limiting the size, and then edit it. My idea is to create a thumbnail of the large photo with the same size as the screen for editing, and then, when the editing is finished, use the large photo to…
lingtianlan
  • 304
  • 2
  • 7
5
votes
1 answer

How to use renderInContext: with CGBitmapContextCreate and Retina?

I have manually created a CGBitmapContext: bitmapContext = CGBitmapContextCreate( myImageData, width, height, 8, 4 * width, colorSpace, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big ); And drawing a layer to it: [self.myView.layer…
anna
  • 2,723
  • 4
  • 28
  • 37
3
votes
2 answers

iPhone: Retina Display Writing Font to a UIImage

Objective-C Answers are fine, I am using MonoTouch for reference. I am writing text on top of a UIImage. Retina displays the font in a choppy way. Looks pixel doubled, which I guess is what's happening. How can I get a crisp Font written to a…
Ian Vink
  • 66,960
  • 104
  • 341
  • 555
3
votes
1 answer

iOS inverted coordinates chaos

So I am using CGBitmapContext to adapt a software blitter to iOS. I write my data to the bitmap, then I use CoreGraphics functions to write text over the CGBitmapContext. The software blitter uses Upper Left Hand Origin, while the CoreGraphics…
user563948
  • 31
  • 1
  • 2
3
votes
0 answers

invalid data bytes/row:CGBitmapContextCreate: CGContextDrawImage: invalid context 0x0

I'm trying to convert array of images into a video file. In the process I have to fill pixel buffer from selected images. Here is the code snippet: CVPixelBufferLockBaseAddress(pixelBuffer, 0) let pixelData =…
3
votes
0 answers

Pixel Manipulation in CGBitmapContext depend on the view's superview?

I came across something really strange with while manipulating pixels using CGBitmapContext. Basically I'm changing the Alpha values of PNGs. I have an example where I can successfully Zero the Alpha value of a PNGs pixel EXCEPT when my ImageView's…
LampShade
  • 2,675
  • 5
  • 30
  • 60
3
votes
1 answer

Replace specific color in CGBitmapContext

How can I replace specific color(RGB value) in CGBitmapContext that has already drawn? Is there any easy way? Thanks in advance.
Jun
  • 3,422
  • 3
  • 28
  • 58
2
votes
0 answers

iPhone - Image created with CGBitmapContextCreate as Opengl texture

I want to call CGBitmapContextCreate with texture->data to create a CGContextRef, and create a CGImageRef by CGBitmapContextCreateImage(context). However, the image created is not as expected :( The one created from CGBitmapContextCreateImage: The…
LKS
  • 673
  • 2
  • 10
  • 21
2
votes
0 answers

error in CGBitmapContextCreate

i'm trying to create UIImage from the sampleBufferData and here what i have in the console : CGBitmapContextCreate: invalid data bytes/row: should be at least 1920 for 8 integer bits/component, 3 components, kCGImageAlphaPremultipliedFirst. :…
2
votes
1 answer

Invalid parameters in CGBitmapContext constructor

I'm trying to create a blank bitmap in a Xamarin.iOS project using the CGBitmapContext constructor(s). However, no matter what I try I just get the error "System.Exception: Invalid parameters to context creation" Example code: const int width =…
Stuart Whitehouse
  • 1,421
  • 18
  • 30
2
votes
1 answer

What's the meaning of kCGBitmapByteOrder32Little

What are the meaning all of CGBitmapInfo constants? typedef CF_OPTIONS(uint32_t, CGBitmapInfo) { kCGBitmapAlphaInfoMask = 0x1F, kCGBitmapFloatInfoMask = 0xF00, kCGBitmapFloatComponents = (1 << 8), kCGBitmapByteOrderDefault = (0 << 12), …
Tryndamere
  • 23
  • 4
2
votes
0 answers

iOS custom image crop using paths

I need to implement a custom image crop on iOS and I can't seem to be able to find a technology that will allow me to do that easily. The goal is to have an interface as follows: The idea is to have some sort of path or something around the face…
mcottingham
  • 1,926
  • 2
  • 18
  • 28
2
votes
0 answers

Getting an image from a sample buffer

I am trying to capture a screen shot on the ipad while the camera is on. My code looks exactly like the AVCaptureFrames from the Xamarin MonoTouch sample: For some reason, though, I keep getting an Invalid Handler Exception. I have looked at other…
2
votes
2 answers

"Invalid Handle" Create CGBitmapContext

I've got a problem with the CGBitmapcontext. I get en error while creating the CGBitmapContext with the message "invalid Handle". Here is my code: var previewContext = new CGBitmapContext(null, (int)ExportedImage.Size.Width,…
Alex
  • 459
  • 3
  • 14
1
2 3