Search Results

Search found 21 results on 1 pages for 'nsimageview'.

Page 1/1 | 1 

  • Changing the value of an NSImageView when it is edited via the control

    - by Septih
    Hello, I have an NSImageView which is set to editable. I would like to be able to revert to a default image when the user deletes the image. I've tried changing the value that the NSImageView is bound to in the setter, but the getter is not called afterwards, so the NSImageView is blank, despite the bound value being set to another image. Here is the setter code: -(void)setCurrentDeviceIcon:(NSImage *)newIcon { [self willChangeValueForKey:@"currentDeviceIcon"]; if(newIcon == nil) newIcon = [currentDevice defaultHeadsetIcon]; currentDeviceIcon = newIcon; [self setDeviceChangesMade:YES]; [self didChangeValueForKey:@"currentDeviceIcon"]; } How should I make the NSImageView update it's value? Thank You.

    Read the article

  • Cocoa -- getting a simple NSImageView to work

    - by William Jockusch
    I am confused about why this code does not display any image: In the app delegate: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { NSRect rect = window.frame; rect.origin.x = 0; rect.origin.y = 0; BlueImageView *blueImageView = [[BlueImageView alloc]initWithFrame:rect]; window.contentView = blueImageView; // also tried [window.contentView addSubview: blueImageView]; } BlueImageView.h: @interface BlueImageView : NSImageView { } @end BlueImageView.m: @implementation BlueImageView - (id)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { [self setImage: [NSImage imageNamed:@"imagefile.png"]]; NSAssert(self.image, @""); NSLog (@"Initialized"); } return self; } - (void)drawRect:(NSRect)dirtyRect { } @end The file imagefile.png exists. The NSAssert is not causing an exception. The NSLog is firing. But no image shows up in the window.

    Read the article

  • How to put overlay NSImageView and keep it at the top of a WebView?

    - by frankish
    How to put overlay view (NSImageView) and keep it at the top in front of a WebView ( which runs core animation or )? Standard ordering in interface builder does not help.. imageview is shown in front of the webview but when i load the contents of webview with a tag or only just an html opacity animation, suddently webview takeovers the top position and shows over the imageview. Can't i do this?

    Read the article

  • Adding a Shadow to a NSImageView

    - by Kevin Sylvestre
    Sorry for the seemingly simple question. I have a NSImageView (added in interface builder) and want to add a shadow outline. I tried using the 'Image View Effects' section of the 'Inspector' but this required enabling a core animation layer. If I set it for the 'Content View' I have very strange appearance side effects. If I set it for the 'Image View' the shadow is cropped (sorry, can't resize the image view). Any ideas?

    Read the article

  • How to change the size of NSImageView control from within program?

    - by Adam
    The following line of code displays an image on my application window, within an NSImageView control named outputImageView. I used Interface Builder to put the NSImageView control onto the window, initially (then bound it to outputImageView). How do I change the size of the NSImageView control within my program, so that it matches the size of the actual image I am displaying (which may change, periodically)? And what if I wanted to change the anchor point for the image (i.e., centered, left edge, bottom right, or whatever? Thanks in advance! [outputImageView setImage: outputImage];

    Read the article

  • Core Animation not working on Leopard, working on Snow Leopard

    - by Nick Paulson
    Hi, I animate NSImageViews using its animator proxy. While testing my application on Snow Leopard, everything works as expected. However, on Leopard, none of the animations are functioning. In addition, NSImageViews don't seem to take into effect the alphaValue I set on them, whether through the animator proxy or not. The only way I can get them to disappear is by setting their image to nil. What is weird is that this all works fine in Snow Leopard, but does not work on Leopard 10.5.8. Any idea on why this may be occurring?

    Read the article

  • NSImage from website URL

    - by happyCoding25
    Hello, I need to create an NSImage from a url and then set it to an image view in my application. I tried some code I found online but it didn't work. If anyone knows how to do this any help would be great. Thanks

    Read the article

  • [NSCustomView isOpaque]: message sent to deallocated instance 0x123456

    - by JxXx
    Hi all I receive that message in debugger console since I added the following arguments for debugging my application with XCode. NSZombieEnabled: YES NSZombieLevel: 16 I was looking for zombie objects... Before doing so, the application failed before I could know where what and why was happening.... Now I´m pretty sure that 'something' outside code is trying to access an object previously released and I can't know where or why it happens neither where it was released... My application is based on this proof of concept (very interesting and colorful) of QuartzCore Framework: http://www.cimgf.com/2008/03/03/core-animation-tutorial-wizard-dialog-with-transitions/ Based on it, I added a few more nsviews to my project and a title and an index to each one, also I added some buttons, text and images depending on what 'dialog' (ACLinkedView object) it was... The transition from an ACLinkedView object to another is going through a validation that depends on the view where you are ... As you see I used this proof of concept as the foundation of my application and it grew and grew into an application that makes use of configuration files, web services (using gSOAP and C ...) I hope you can give me some clues to where is my error ... I´ve been the hole week debugging unsuccessfully, as I said before, I think that that message comes from a point outside my code. I'd say that the problem s related with bad memory allocation or automatisms (nearly completely unknowns for me) during loading the nib components... I will try to explain all this with parts of mycode. This is my ACLinkedView definition: #import <Cocoa/Cocoa.h> @interface ACLinkedView : NSView { // The Window (to close it if needed) IBOutlet NSWindow *mainWindow; // Linked Views IBOutlet ACLinkedView *previousView; IBOutlet ACLinkedView *nextView; // Buttons IBOutlet NSButton *previousButton; IBOutlet NSButton *nextButton; IBOutlet NSButton *helpButton; //It has to be a Button!! IBOutlet NSImageView *bannerImg; NSString *sName; int iPosition; } - (void) SetName: (NSString*) Name; - (void) SetPosition: (int) Position; - (NSString*) GetName; - (int) GetPosition; - (void) windowWillClose:(NSNotification*)aNotification; @property (retain) NSWindow *mainWindow; @property (retain) ACLinkedView *previousView, *nextView; @property (retain) NSButton *previousButton, *nextButton, *helpButton; @property (retain) NSImageView *bannerImg; @property (retain) NSString *sName; @end The ACLinkedView's AwakeFromNib is this: #import <Cocoa/Cocoa.h> @interface ACLinkedView : NSView { // The Window (to close it if needed) IBOutlet NSWindow *mainWindow; // Linked Views IBOutlet ACLinkedView *previousView; IBOutlet ACLinkedView *nextView; // Buttons IBOutlet NSButton *previousButton; IBOutlet NSButton *nextButton; IBOutlet NSButton *helpButton; //It has to be a Button!! IBOutlet NSImageView *bannerImg; NSString *sName; int iPosition; } - (void) SetName: (NSString*) Name; - (void) SetPosition: (int) Position; - (NSString*) GetName; - (int) GetPosition; - (void) windowWillClose:(NSNotification*)aNotification; @property (retain) NSWindow *mainWindow; @property (retain) ACLinkedView *previousView, *nextView; @property (retain) NSButton *previousButton, *nextButton, *helpButton; @property (retain) NSImageView *bannerImg; @property (retain) NSString *sName; @end (As you can see the initialization of each ACLinkedView object depends on it's position wich is seted up into the Interface Builder by linking actions, buttons and CustomViews... Does I explain enough? Do you think that I should put more of my code here, i.e. AppDelegate definition or it´s awakeFromNib method? Can you help me in any way? Thanks in advance. Juan

    Read the article

  • Gray border when using NSBorderlessWindowMask

    - by bare_nature
    Hello, Whenever I try to create a custom window using NSBorderlessWindowMask and set an NSView (for example an NSImageView) as its contentView, I get a 1px gray border around the NSView and I don't seem to be able to get rid of it. I have followed several approaches including Apple's RoundTransparentWindow sample code as well as several suggestions on StackOverflow. I suspect the gray border is either coming from the window itself or the NSView. Have any of you experienced this problem or do you have a possible solution? Thanks

    Read the article

  • Is it possible to get an NSView to pass rightMouseDown: to the next responder without subclassing?

    - by Benedict Cohen
    I have a view which contains a few subviews: mainView subViewA subViewB SubViewC mainView is an NSView constructed from a nib and is controlled with an NSViewController subclass. The subviews are standard views such as NSTextField and NSImageView and are configured to be non-editable. I want mainView to receive rightMouseDown: even when the event is triggered in one of the subviews. The default implementation of rightMouseDown: in NSResponder passes the event to the next responder, but NSView changes the default behaviour and does not pass it to the next responder. I could subclass all of the subviews but this doesn't seem like a very elegant or maintainable solution. How can I get the subviews to pass rightMouseDown: messages to the next responder without subclassing all of the subviews?

    Read the article

  • Core Data Image Won't Load Into NSTableView Image Cell

    - by jcady
    In my code I am storing an image into my Core Data model (works fine). If I set up my view to have an NSImageView and bind its Data to Controller Key: selection and modelKeyPath: myImagePath, it works. It will show each image for the selected row. I then create a new column in my NSTableView and drag an image cell onto the column. However, I cannot get my Core Data bindings to have the image show up in the cell. I have tried binding both value and data, but no luck. Since I am sure the image is stored properly, what am I doing wrong in my binding to prevent the image from showing up in the table cell? Thanks so much. (My background: new Cocoa developer who has recently gone through the entire Hillegass book.)

    Read the article

  • NSScrollView jumping to bottom on scroll

    - by Nick Locking
    I have an NSScrollView containing an NSImageView, which resizes based on various factors. When it resizes I have generally changed the image, so I scroll the NSScrollView to the top. This works fine. However, when I start to scroll the NSScrollView again, it moves a few pixels and then (most of the time) jumps to the bottom of the scroll. After it jumps once, it works as normal until I move the scroller to the top again. This is driving me insane. All I'm really doing is this: [_imageView setImage: anNSImage]; NSRect frame; NSSize imageSize = [anNSImage] size]; frame.size = imageSize; frame.origin = NSZeroPoint; [_imageView setFrame: frame]; [[_mainScrollview contentView] scrollToPoint: NSMakePoint(0, [_imageView frame].size.height - [_mainScrollview frame].size.height)];

    Read the article

  • NSImage different size in code different shown by Finder/Preview

    - by krasnyk
    I have a couple of images that i use in my application(one of them is attached). The strange thing is that the real image size(shown by finder and preview) is 1200x701 px. When I access image from the code and as for its size, I get 360x210px. What is going on? Code I'm using to get the size of the image: NSImage *newImg = [[NSImage alloc] initWithContentsOfURL: [NSURL URLFromPasteboard:[sender draggingPasteboard]]]; float h = [newImg size].height; //height is 210px - should be 701px float w = [newImg size].width; //width is 320px - should be 1200px The content of the newImg is the same image that has been pointed and loaded - I display it in the NSImageView anyway so I see. Just the size taken with -size is wrong. This is the image:

    Read the article

  • Core Animation cross-dissolve between one string (or image) and another when changing bound value?

    - by danwood
    I have an NSTextView and an NSImageView that is bound to a NSString and an NSImage in my code. I would like to have the displayed string and image cross-dissolve when I change the string and image in code. Any way to do this? Do I need to stop using bindings? (And if I do, is there any trick to getting the string and the image to cross-dissolve when I change the value, or do I have to do something weird like fade it out and fade a new one back in?)

    Read the article

  • Image Wells, Core Data, and Sqlite files.

    - by Sway
    I've got a mac application that I've developed. I use it to create sqlite files that are bundled with my iphone app. The mac app uses Core Data and bindings and is working fine except for one "weird" issue. I use an NSImageView (or Image Well) to allow me to drag and drop jpg files. This is bound through to an optional binary attribute in my model class. For some reason when I drag and drop a 4k jpg file it onto the image well and save the sqlite file. The data saved to the binary column is over 15 times larger than it should be. Whereas if I use an application like SQLiteManager and add the image into the row in the database. The binary data is the correct (expected size). File 4k jpg Actual size: 2371. Persisted via Core Data size: 35810. Can anyone give me a suggestion as to why this might be happening? Do I need to set some setting in Interface Builder or write some custom code?

    Read the article

  • Saving NSBitmapImageRep as NSBMPFileType file. Wrong BMP headers and bitmap content

    - by niko34
    I save a NSBitmapImageRep to a BMP file (Snow Leopard). It seems ok when i open it on macos. But it makes an error on my multimedia device (which can show any BMP file from internet). I cannot figure out what is wrong, but when i look inside the file (with the cool hexfiend app on macos), 2 things wrong: the header have a wrong value for the biHeight parameter : 4294966216 (hex=C8FBFFFF) the header have a correct biWidth parameter : 1920 the first pixel in the bitmap content (after 54 bytes headers in BMP format) correspond to the upper left corner of the original image. In the original BMP file and as specified in the BMP format, it should be the down left corner pixel first. To explain the full workflow in my app, i have an NSImageView where i can drag a BMP image. This View is bind to an NSImage. After a drag & drop i have an action to save this image (with some text drawing over it) to a BMP file. Here's the code for saving the new BMP file : CGColorSpaceRefcolorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); CGContextRefcontext = CGBitmapContextCreate(NULL, (int)1920, (int)1080, 8, 4*(int)1920, colorSpace, kCGImageAlphaNoneSkipLast); [duneScreenViewdrawBackgroundWithDuneFolder:self inContext:context inRect:NSMakeRect(0,0,1920,1080) needScale:NO]; if(folderType==DXFolderTypeMovie) { [duneScreenViewdrawSynopsisContentWithDuneFolder:self inContext:context inRect:NSMakeRect(0,0,1920,1080) withScale:1.0]; } CGImageRef backgroundImageRef = CGBitmapContextCreateImage(context); NSBitmapImageRep*bitmapBackgroundImageRef = [[NSBitmapImageRepalloc] initWithCGImage:backgroundImageRef]; NSData*data = [destinationBitmap representationUsingType:NSBMPFileType properties:nil]; [data writeToFile:[NSStringstringWithFormat:@"%@/%@", folderPath,backgroundPath] atomically: YES]; The duneScreenViewdrawSynopsisContentWithDuneFolder method uses CGContextDrawImage to draw the image. The duneScreenViewdrawSynopsis method uses CoreText to draw some text in the same context. Do you know what's wrong?

    Read the article

1