How to drag image into Mac app? - xcode

I'm building a Mac app. I want to be able to drag an image into my app and then press a button to resize the image into a smaller dimension. Then, I will export the image back to the original folder it came from. (Similar to the app Prepo)

Take a look at Drag and Drop Programming Topics.
Cocoa gives you the ability to implement sophisticated drag-and-drop
capabilities both within your application and between applications.
This programming topic describes how you can implement drag-and-drop
with just a few methods.

Related

How to create a global overlay for MacOS?

I am trying to develop a MacOS application using Xcode and Cocoa. My intent is to create an overlay on the user's screen that is mostly transparent, and does not register input. For example, an application like f.lux tints the colour of your entire screen like a global overlay, but you can still click on-screen items, as mouse clicks go right through (assuming that it's an overlay). How can I get started with achieving a similar overlay/widget?

Develop an iPhoto-like cocoa app for mac OSX

I plan to develop a mac OSX app that has a UI similar to that of iPhoto - a panel on the left and a grid view of images on the right. I am thinking of using NSSplitView to create two panels and using NSCollectionView for the grid.
I guess this must be a pretty popular and common UI pattern for mac apps. I am new to cocoa development. Can anyone with previous experience point me to any related cocoa code samples and design document?
Thanks a lot in advance.
N.B.
This missing piece here is an NSOutlineView in source list mode, put that in your left pane. But otherwise seems like a good place to start.
You might also be interested to see what the developer of Sonora approached this problem; although this is a music app the layout is almost the same.

Simple GUI library for basic GLUT CAD application?

I want to create a very simple CAD application written with GLUT library. I just need this to create simple dice editor application for computer graphics class, so an easy-to-use GUI library that supported GLUT is what I basically need for this project. I stumble upon GLUI, but it doesn't have widgets such as color chooser or file loader dialog. Is there a suitable GUI library for GLUT that I can use?
There are gui libraries like Qt or FLKT, but they have their own main loop.
on windows you should call directly the native files dialogs GetOpenFileName() and GetSaveFileName(). If you want a cross platform solution and to exactly answer the question, yes there is "a suitable GUI library for GLUT that (you) can use": look for tiny file dialogs on sourceforge it even has a color chooser and has no main loop.
You want a simple GUI library yet you want it to have advanced features.
Open File Dialog
Depending on what OS you want it to be running on you can pop up the OS specific file opening dialog. It does not have to be shown inside of the application window. Instead let it pop a new window with the OS file open dialog.
Color Chooser
Implementation of a simple Color Picker widget is not that hard really. Three sliders for RGB and a box to show the color chosen.
You can also use the OS (Windows) specific color picker. And skip the implementation inside you app altogether.

Windows Mobile 6.5 - camera life preview and image capture using my own dialog

Im writing an application for workers in our factory and one of requirements is that they should be able to take images using camera integrated in PDA with WM6.5.
The main difficulty is, that thay MUST NEVER EVER be able to enter windows, Start button, desktop etc. They are allowed ONLY to see my fullscreen application.
I succesfully deactivated BlueTooth + red, green and volume buttons (if you are interested, im pasting links here)
http://forum.xda-developers.com/showthread.php?t=546737
http://msdn.microsoft.com/en-us/library/bb431750.aspx
http://social.msdn.microsoft.com/forums/en-US/vssmartdevicesvbcs/thread/a4f9f41d-47a8-4080-8613-2c2ddcf4c012/
And now I have to implement the camera function. But as CameraCaptureDialog opens a new dialog and shows start button, task bar and allows user to open list of applications, I must not use it.
I must create my own dialog that will show the Live Preview in a panel or in an imageBox and photo will be taken using a button.
I searched the whole internet and found only DirectShow.NETCF (but people do not recommend it) and CameraCaptureDialog.
Can I somehow redirect the CameraCaptureDialog to my dialog? Or can I access camera directly via .NET framework? Or can I modify the CameraCaptureDialog not to show Start button, menu etc?
Looks like you have a bit of a challenge. I agree that Directshow is a questionable solution, but it may be your only option. I did get http://alexmogurenko.com/blog/directshownetcf/ to work, but only on low resolutions.
A better option might be to find a device that does not show the menu bar/start button. AFAIK, the HTC HD2 has a very clean Cameracapturedialog..
Good luck.

Which controls to use for a Mac OS X application?

I developed some app for iPhone/iPad, so I know the basic concepts of Cocoa programming. Now I need to write a Mac OS X application. If you help me to choose the right controls to use, I'll study the Apple documentation reference for them.
I need:
a control to show a grid of thumbnails (png images); I'll be able to change the order of the thumbnails by dragging and dropping them;
a control to show a single image (e.g. UIImageView of Cocoa Touch) with the possibility to drag and drop another image over the first one; besides I need to move and resize the second image by dragging its corners (as if corners were "anchors");
a control to browse the media files on the Mac (possibly iPhoto images, iTunes DRM-free songs, or simply the content of a given folder), like the media browser of iMovie.
I use Xcode 4.2.
You can use NSCollectionView and co. for this. Xcode has a sample application somewhere in documentation (browsing various images) as well as tutorial on how to setup NSCollectionView yourself.
Check NSImageView. You can basically find any Cocoa control alternative to Cocoa Touch just by changing UI prefix to NS.
There is no such control per-se (unless IKImageBrowser for backgrounds), but using aforementioned NSCollectionView and some API for media files you should get around pretty quickly.
Also check ImageKit framework for images (for browsing, viewing and modifying).

Resources