quartz-graphics

Able to download package in R but not call it from library?

一曲冷凌霜 提交于 2020-01-07 02:28:11
问题 I was able to download the package "LMERConvenienceFunctions" The downloaded binary packages are in /var/folders/2p/3h5yk1gx4fs1gd8gtdbhdd900000gn/T//RtmpHvJyRm/downloaded_packages However when I try to call it using: library(LMERConvenienceFunctions) I get the following error: Error : .onLoad failed in loadNamespace() for 'rgl', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object'/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgl/libs/rgl

How to save and read a CGLayerRef, in a NSmutableArray

纵然是瞬间 提交于 2020-01-06 04:16:05
问题 i have a question about the CGLayerRef "elements" ( because they are not object !) In my app, i want to store a list of CGLayerRef created from bitmaps, for obtain a good framerate on my DrawRect. how can i store and read the CGLayerRef in this code ? This is the code for store in the NSMutableArray CGLayerRef imageLayer; // create my layer... // init my NSMutableArray if (layerTable == nil) { layerTable = [[NSMutableArray alloc] init]; } // and store my CGCLayer in this array with NSValue

Issues with screen capture on OS X - CGDisplayCreateImage

末鹿安然 提交于 2020-01-04 21:29:20
问题 I am using CGDisplayCreateImage(CGMainDisplayID()) to capture screen. When we do a fast user switch to another user, it still captures screen from first user. CGMainDisplayID() on second user returns 1104977152. Any idea why this is happening? My intention is to capture active screen. In case of mirroring, I don't mind capturing the active display. Other than Quartz APIs, any other suggestions? 来源: https://stackoverflow.com/questions/31475656/issues-with-screen-capture-on-os-x

How to take a layer's snapshot with mask layer?

巧了我就是萌 提交于 2020-01-04 04:54:23
问题 I added a mask to UIView's layer: CGImageRef maskImageRef = [UIImage imageNamed:"Icon.png"].CGImage; CALayer maskLayer = [CALayer layer]; maskLayer.contents = (__bridge id)maskImageRef; self.layer.mask = maskLayer; Then I use this code to get snapshot from a UIView: [self.layer renderInContext:mainViewContentContext]; But the mask wasn't drawn. How to draw self.layer with mask? Special thx! 回答1: One way to fix this can be to use Quartz functions Use CGContextClipToMask(context, rect,

Does CGContextSetTextMatrix work for offscreen bitmaps?

感情迁移 提交于 2020-01-02 09:44:46
问题 I'm creating an image offscreen using a context from CGBitmapContextCreate() . While drawing text, I tried to use the: CGContextSetTextMatrix(contextRef, CGAffineTransformMake(1.0, 0.0, 0.0, -1.0, 0.0, 0.0)); but my text was still upside down. If I used the standard transforms it was correct: CGContextTranslateCTM(contextRef, 0.0, contextRect.size.height); CGContextScaleCTM(contextRef, 1.0, -1.0); My question is should the CGContextSetTextMatrix work for an offscreen bitmap? Maybe I was doing

Does CGContextSetTextMatrix work for offscreen bitmaps?

人盡茶涼 提交于 2020-01-02 09:42:13
问题 I'm creating an image offscreen using a context from CGBitmapContextCreate() . While drawing text, I tried to use the: CGContextSetTextMatrix(contextRef, CGAffineTransformMake(1.0, 0.0, 0.0, -1.0, 0.0, 0.0)); but my text was still upside down. If I used the standard transforms it was correct: CGContextTranslateCTM(contextRef, 0.0, contextRect.size.height); CGContextScaleCTM(contextRef, 1.0, -1.0); My question is should the CGContextSetTextMatrix work for an offscreen bitmap? Maybe I was doing

CALayer vs. drawInRect: performance?

旧巷老猫 提交于 2020-01-02 07:54:29
问题 I'm trying to draw some shadows in a rect. The shadow image itself is about 1px * 26px. Here's two methods I've thought of for drawing the image in the view: //These methods are called in drawRect: /* Method 1 */ [self.upperShadow drawInRect:rectHigh]; //upperShadow is UIImage [self.lowerShadow drawInRect:rectLow]; /* Method 2 */ CALayer *shadowTop = [CALayer layer]; shadowTop.frame = rectHigh; shadowTop.contents = (__bridge id)topShadow; //topShadow is CGImage [self.layer addSublayer

CIFilter available in iOS?

泄露秘密 提交于 2020-01-02 05:43:36
问题 I want to know for sure before I start implementing my own filters (probably using opengl ES) but are the CIFilters available on iOS? Anything similar? 回答1: CIFilters are not currently available in the SDK. If it's something you'd wish to see, you should file a request with Apple. 回答2: Update: CIFilters are now included in iOS 5. 来源: https://stackoverflow.com/questions/483039/cifilter-available-in-ios

How to animate layer shadowOpacity?

自作多情 提交于 2019-12-31 08:25:32
问题 I have a view on which I've set the layerOpacity to 1. theView.layer.shadowOpacity = 1.0; This looks fine when the view is farther down the screen. When I move this view up to be flush with another view that has a shadow, they don't look good. Is there a way I can animate the shadowOpacity on my layer to be 0? I tried using an animation block but it seems as if this property is not animatable. EDIT: Request for code that doesn't work: [UIView animateWithDuration:1.0 animations:^{ splitView2

How to animate layer shadowOpacity?

半城伤御伤魂 提交于 2019-12-31 08:24:30
问题 I have a view on which I've set the layerOpacity to 1. theView.layer.shadowOpacity = 1.0; This looks fine when the view is farther down the screen. When I move this view up to be flush with another view that has a shadow, they don't look good. Is there a way I can animate the shadowOpacity on my layer to be 0? I tried using an animation block but it seems as if this property is not animatable. EDIT: Request for code that doesn't work: [UIView animateWithDuration:1.0 animations:^{ splitView2