Resize handlers on Cappuccino - cappuccino

how do I add the resize handlers to a CPView in Cappuccino? I saw an example that has rotation handlers, but I want to resize the view freely.
Rotate example

It's the exact same concept, but slightly easier...
I wrote this a while back to do what you want... it should help.
https://gist.github.com/1623499

Related

How to make CGWindowListCreateImage render correct background color?

Capturing an image of an off-screen window with CGWindowListCreateImage is a common way to create QuickLook style zoom-in animations, but this seems create an image with the wrong background colour, slightly lighter than the real window.
This causes a flash at the end of the animation which kind of ruins the effect.
Does anyone have any idea why this happens and what can be done about it?
EDIT: I created a demonstration app for this problem. It is a bit large and complex for a Stack Overflow question, but the relevant code is probably in the ZoomingWindow.m methods takeSnapshot and makeAndPrepareSnapshotWindow.
Setting the window appearance to textured in Interface Builder fixed this. Of course that also changes the color of the window, but that is acceptable in this particular case.

How to make a sort of scratchboard in flash?

I was wondering if someone could teach me how to make a scene in flash where you have an image on top of the other, and you can scratch the top one off to show what's below.
Kinda like those prize cards where you have to scratch the silver thing to see if there's a prize below.
Anyone has any idea if this is even possible in flash?
Yes it's possible, here is one example. I'm sure there are others.
The concept is that you use a mask to hide the image. Then use a mouse move event listener to draw on the mask as the user mouses over the object. Parts of the mask that have something on them (ie: the stuff you're drawing in the mouse move listener) will then reveal the underlying object that was being masked.

CoreImage transition between NSViews

One year at WWDC apple showed using CoreImage transitions to switch between two NSViews. It was a simple example where changing tabs changed the view with a swirl animation or something like that. The presenter joked never to actually do something like this in a real app. Does anyone remember that sample and remember what it was called or have a link?
Reducer has an AnimatingTabView that uses CIFilters to animate switching between tabViews.
http://developer.apple.com/library/mac/#samplecode/Reducer/Introduction/Intro.html

Best way to animate a circle moving around a screen in Qt?

If I wanted to, using Qt, simply have some circles move around in a white box, or a graphic, what would be the best method of this?
Would I need to draw white/the graphic behind where the circle moved from every time? Is there a simple way of accomplishing this in Qt?
Create QGraphicsView object to your widget and added a QGraphicsScene to view.
Add a QGraphicsEllipseItem to scene
Use QPropertyAnimation to change the "pos" property of the ellipse item.
If you need more advanced features, you can build your own animation class on QPropertyAnimation.
enjoy it:)
Update: You can read Qt's Next Generation UI for more information.
Subclass a QWidget. Start a timerEvent() to animate the positions of the circles, then call update() at the end to schedule a repaint of the widget. Override the widget's paintEvent() - in there you draw your background and circles, using a QPainter object. The Qt Assistant has examples of how to use QPainter.
Qt also has a new animation framework that may facilitate something like this, but I have not looked into it.

Creating a quick look style zooming effect

I would like to create an effect than an image zooms up from a thumbnail size to full screen.
I am not sure what's the right steps to achieve this. Should I create a transparent full screen window and animate a layer on top of it?
Take a look at this CoreGraphics example. Specifically, take a look at the "grow" and "shrink" animations. That's how Apple does it, and that's what you'll want to do too.
Your solution of a transparent window with a CALayer inside is probably the best supported way to do it.
One thing that seems like it should be a good solution (at least it's the first thing I thought of when I wanted to do this) but isn't is NSView's enterFullScreenMode:withOptions:. If memory serves, it was originally meant to do what you're talking about here, but the animation was taken out and it generally doesn't work that well now.

Resources