mammaiap
mammaiap

Reputation: 11

how to set the IKImageBrowserView with variable cell sizes?

I am developing a tool which will allows the user to import the video clips and make the movie from those video clips.

To represent the imported video clips i have created the IKImageBrowserView and add the frameimage of the videoclip as a Thumbnail image. up to here everything is working.

But now i wanted to display the thumbnail image size based on the video clip duration. i.e each and every thumbnail image have the different size based on the duration. (i wanted to show the thumbnail image width going to be changed based on the duration of the video clip.

If i use [imageBrowser setCellSize:];then it will affect all the thumbnail sizes. but i wanted to apply different size for each and every thumbnail.

Can anybody help me to solve this problem?

if IKImageBrowserView is not the best suitable for my problem then please suggest me the best control to solve my problem.

Upvotes: 0

Views: 564

Answers (1)

Vincent Wayne
Vincent Wayne

Reputation: 36

The best solution will be implementing your own IKImageBrowserCell subclass for your custom IKImageBrowserView

First of all, you need to subclass the IKImageBrowserView and override newCellForRepresentedItem: In this method, return an instance of your own subclass of IKImageBrowserCell.

In your subclass of IKImageBrowserCell, override the following methods to modify the layout dynamically based on the represented video clip: (To retrive the video clip data model which should conform to the informal protocol, IKImageBrowserItem, use -[IKImageBrowserCell representedItem])

- (NSRect) imageContainerFrame;
- (NSRect) imageFrame; 
- (NSRect) selectionFrame;
- (NSRect) titleFrame;
- (NSRect) subtitleFrame;   
- (NSImageAlignment) imageAlignment;

There is also a demo project on ADC which can be found at

http://developer.apple.com/library/mac/#/legacy/library/samplecode/ImageKitDemo/Introduction/Intro.html

Upvotes: 1

Related Questions