core-graphics

SCNShape not drawing with UIBezierPath under certain circumstances

痴心易碎 提交于 2019-12-08 11:48:14
问题 I believe this may be an iOS bug, and I've reported it to Apple via Bug Report. I'll post it here in case there's some workaround I can use, or explanation of the cause. I'm wanting to draw the stroke of a UIBezierPath within SceneKit. I'm using the CGPath copyStrokingWithWidth function, and then creating a SCNShape using the given path. This works fine for lines with 2 points, but on lines with 3 points, the SCNShape doesn't display anything. I've determined that this is only the case when

how Add mirror image to 2d Box corners

ぃ、小莉子 提交于 2019-12-08 11:42:40
问题 hello friends i need to add mirror image in right corner and bottom . i create the type of view with the help of this answer how to create a view like this shape in swift? but i am not able to add image in right corner and bottom 回答1: Current approach is somewhat different from the previous one. Previously i've drawn the right and bottom corner and resized the image such that, the appearance is asked in that question. But in this question, that approach won't work anymore. First reason is

how to add part of Face A to Part of face B, most importantly matching color tones

孤者浪人 提交于 2019-12-08 11:31:29
问题 i have been successful in detecting faces, cropping and pasting in new imageHow ever i am looking a way to mix color tone of face A to Face B. So, if you look and face b, cropped image color tone not matching to face B face color. how can i do this to max % matching. It would be good to have exact solution, however links or approach will be appreciated. I can provide code for cropping and pasting. Thanks 回答1: Since it seemed to be helpful for you, fading the edges of the images as described

UITabBarItem image created in code doesn’t appear

杀马特。学长 韩版系。学妹 提交于 2019-12-08 11:15:00
问题 I create the following View in code, the idea is to use it as an image in UITableViewCell and UITabBarItem : - (void)drawRect:(CGRect)rect { // Fill the background with white CGContextRef context = UIGraphicsGetCurrentContext(); UIColor * whiteColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0]; CGContextSetFillColorWithColor(context, whiteColor.CGColor); CGContextFillRect(context, self.bounds); //// Color Declarations UIColor* fillColor = [UIColor colorWithRed: 1.0 green: 1.0

iphone: rewrite GLPaint using Core Graphics

柔情痞子 提交于 2019-12-08 09:58:21
问题 I would like to rewrite the Apple source code, GLPaint application, but not using OpenGL like the example, I would like to use Core Graphics library. But I stuck in displaying the texture like GLPaint. This is my code in Core Graphics: - (void) drawLineFromPoint: (CGPoint) fromPoint toPoint: (CGPoint) toPoint { UIGraphicsBeginImageContext(self.frame.size); CGContextRef context = UIGraphicsGetCurrentContext(); [drawImage.image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size

Apple OSX OpenGL offline rendering with CoreGL

≯℡__Kan透↙ 提交于 2019-12-08 06:41:28
I'm trying to render on OSX using CoreGL and a Framebuffer: it seems that the triangle rendering is not working at all, while for example a glClear with a color will be shown in the resulting PPM image. I've tried several variation of the code below, but right now it seems to me that this is an impossible task on OSX. #include <stdio.h> #include <OpenGL/OpenGL.h> #include <Opengl/glext.h> #include <stdlib.h> #include <assert.h> #include <opengl/gl3.h> int main(int argc, const char * argv[]) { CGLContextObj context; CGLPixelFormatAttribute attributes[13] = { kCGLPFAOpenGLProfile,

Ported OSX Obj-C/CG Screenshot Code to js-ctypes - crash on final line

北战南征 提交于 2019-12-08 06:31:48
问题 I ported some objective-c/CoreGraphics code that takes a screenshot of multiple monitors but it's not working. The jsctypes guys won't be able to help because the section is just me answering questions lol The objc/cg code is from here: https://stackoverflow.com/a/28247749/1828637 My jsctypes type/struct/declares are here: https://github.com/Noitidart/NativeShot/blob/mac-troubleshooting/modules/ostypes_mac.jsm The jsctypes port is here: https://github.com/Noitidart/NativeShot/blob/mac

Apple OSX OpenGL offline rendering with CoreGL

落爺英雄遲暮 提交于 2019-12-08 06:19:22
问题 I'm trying to render on OSX using CoreGL and a Framebuffer: it seems that the triangle rendering is not working at all, while for example a glClear with a color will be shown in the resulting PPM image. I've tried several variation of the code below, but right now it seems to me that this is an impossible task on OSX. #include <stdio.h> #include <OpenGL/OpenGL.h> #include <Opengl/glext.h> #include <stdlib.h> #include <assert.h> #include <opengl/gl3.h> int main(int argc, const char * argv[]) {

How to make a filling progress circle in iOS?

血红的双手。 提交于 2019-12-08 06:17:23
问题 I need to make a progress circle like this: I have created a CAShapeLayer for the circle, and animate its strokeEnd property like this: pieShape = CAShapeLayer() pieShape.path = UIBezierPath(arcCenter: CGPointMake(29, 29), radius: 27.0, startAngle: CGFloat(startAngle), endAngle: CGFloat(endAngle), clockwise: true).CGPath pieShape.fillColor = UIColor.clearColor().CGColor pieShape.strokeColor = UIColor.blackColor().CGColor pieShape.lineWidth = 4.0 self.layer.addSublayer(pieShape) let

Drawing with with blur effect on image using opengl

旧时模样 提交于 2019-12-08 05:26:35
问题 I have the same requirement as this question I am right now at situation where i set UIImage on my opengl view. Below is the complete code i used to set uiimage. Also it includes the drawing code. Using below code I am able to set image and drawing on it. when i do not set image in background it allows me to draw blur and smooth drawing but if i set background image it draws solid drawing I want smooth drawing on background image. I have used some of GLPaint code of apple for drawing. - (id