English 中文(简体)
利用我CIImage的推土机在屏幕上不做任何事情
原标题:Using drawAtPoint with my CIImage not doing anything on screen

Stuck again. :( I have the following code crammed into a procedure invoked when I click on a button on my application main window. I m just trying to tweak a CIIMage and then display the results. At this point I m not even worried about exactly where / how to display it. I m just trying to slam it up on the window to make sure my Transform worked. This code seems to work down through the drawAtPoint message. But I never see anything on the screen. What s wrong? Thanks.

而且,只要在窗户特定地点展示,......这是在窗户上设置某种框架的最佳技术,那么就将这个框架的坐标带上,并“重新划入”这个 rec子? 或者使用国际独立企业的具体控制? 还是什么? 再次感谢。

// earlier I initialize a NSImage from JPG file on disk.  
// then create NSBitmapImageRep from the NSImage.  This all works fine.
// then ...
CIImage * inputCIimage = [[CIImage alloc] initWithBitmapImageRep:inputBitmap];
if (inputCIimage == Nil)
    NSLog(@"could not create CI Image");
else {
    NSLog (@"CI Image created.  working on transform");
    CIFilter *transform = [CIFilter filterWithName:@"CIAffineTransform"];
    [transform setDefaults];
    [transform setValue:inputCIimage forKey:@"inputImage"];
    NSAffineTransform *affineTransform = [NSAffineTransform transform];
    [affineTransform rotateByDegrees:3];
    [transform setValue:affineTransform forKey:@"inputTransform"];
    CIImage * myResult = [transform valueForKey:@"outputImage"];
    if (myResult == Nil)
        NSLog(@"Transformation failed");
    else {
        NSLog(@"Created transformation successfully ... now render it");

        [myResult drawAtPoint: NSMakePoint ( 0,0 )
                     fromRect: NSMakeRect  ( 0,0,128,128 )
                    operation: NSCompositeSourceOver
                     fraction: 1.0];                    //100% opaque
        [inputCIimage release];
    }
}

Edit #:

snip - 删除了下文提及的先前编码样本(在关于提纲的评论中),该样本不可行。

Edit #2: 添加一些法典,说明DOES为今后可能 st在同样事情上的任何人工作。 这不肯定是最佳环境方法......但是为了我的迅速和 d脏的目的。 因此,这部新的法典(下文)取代了我最初的提问中从上述全部[MResult der AtPoint......]信息。 该法典采用CIImage变造的形象,并在NSImageView控制中展示。

NSImage *outputImage;
NSCIImageRep *ir;
ir = [NSCIImageRep imageRepWithCIImage:myResult];
outputImage = [[[NSImage alloc] initWithSize: NSMakeSize(inputImage.size.width, inputImage.size.height)] autorelease];
[outputImage addRepresentation:ir];
[outputImageView setImage: outputImage];  //outputImageView is an NSImageView control on my application s main window
最佳回答

因此,解决这一问题的一个办法是,从CIImage公司中设立国家志愿人员联合会,然后在新的NSImage上增加这一代表,然后以各种方式展示国家志愿人员组织。 我在上面添加了我使用的代码一(见“编辑编号2”),其中我展示了NSImageView控制中的“投影”。 Man . What a PITA this was!

问题回答

通常在Cakoa的屏幕上进行,[NSViewferRect:] 我认为你没有这样做,因此,你没有正确的图表背景。





相关问题
Asynchronous request to the server from background thread

I ve got the problem when I tried to do asynchronous requests to server from background thread. I ve never got results of those requests. Simple example which shows the problem: @protocol ...

objective-c: Calling a void function from another controller

i have a void, like -(void) doSomething in a specific controller. i can call it in this controller via [self doSomething], but i don t know how to call this void from another .m file. I want to call ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

NSUndoManager and runModalForWindow:

I have a simple Core Data app which displays a list of entities in the main window. To create or add new entities, I use a second modal window with a separate managed object context so changes can be ...

NSMutableArray values becoming "invalid"

I m trying to show a database information in a tableview and then the detailed information in a view my problem is as follow: I created a NSMutableArray: NSMutableArray *myArray = [[NSMutableArray ...

iPhone numberpad with decimal point

I am writing an iPhone application which requires the user to enter several values that may contain a decimal point (currency values, percentages etc.). The number of decimal places in the values ...

热门标签