Vector based UI design tool that generates ObjC
225 points| aggarwalachal | 14 years ago |paintcodeapp.com | reply
You no longer have to tweak and recompile your drawing code over and over again to achieve the desired result.
225 points| aggarwalachal | 14 years ago |paintcodeapp.com | reply
You no longer have to tweak and recompile your drawing code over and over again to achieve the desired result.
[+] [-] basil|14 years ago|reply
It's not clear from the description but it would be great if it could immediately render whatever Core Graphics code I was writing, as I was writing it, much like this in-development tool (http://www.youtube.com/watch?v=JupqhcT4ONY) which popped up in my Twitter stream a couple days ago.
[+] [-] aggarwalachal|14 years ago|reply
The Core Graphics video is interesting. Live rendering like that can help developers see what they are actually coding. The whole compile and test cycle just breaks the chain of thought which goes on while coding.
[+] [-] coob|14 years ago|reply
Drawing your UI is never ever going to be as cheap as loading a converted PNG (which Apple's modified pngcrush converts for you). I think a lot of devs have the draw/vector vs. precomposed bitmap tradeoff the wrong way round. Drawing all of your gradated UIButtons with CoreGraphics methods is a false economy compared to just loading a stretchable PNG. Almost all of Apple's UI system imagery is bitmap based, and for a good reason.
[+] [-] tezza|14 years ago|reply
It depends a lot on the representation. Bitmap will not get a lot better than what we've got at the moment with JPeg or Gif. Vector representations can vary wildly in compactness and rendering speed. Eg. SVG bad, CSS gradients good. SVG bad, EPS/PDF good.
Obviously drawing from CPU can be much quicker than reading from disk. And if you draw into the GPU buffer first you get all of the advantages of GPU acceleration later.
And it can be much more bandwidth efficient.
Take streaming a bitmap over http. You have to take the penalty of the PNG header, the penalty of assembling a data:url and a 33% fixed penalty for Base64 encoding the binary bits.
So to stream a 1x256px gradient sprite there is a shedload of wasted bits.
If you're in vector land you can just send the gradient endpoints.
If you're not in WebKit land or with pre-sent vector algorithms (rare) you also have to stream the vector drawing code. In that case you can ammortize the cost of the drawing code with a simpler/smaller wire representation.
[+] [-] eaten_by_a_grue|14 years ago|reply
Reference: https://developer.apple.com/library/mac/#documentation/graph... (it works on iOS too)
[+] [-] gdubs|14 years ago|reply
There's also no reason you can't build your images the first time they're used, and save them out to PNG files for successive uses (if profiling determines that it is indeed more optimal). Even if you end up using graphics at runtime, you'll save work by using code to generate your graphics.
For instance, simply write utility programs to generate all of your graphics with code -- this is definitely faster than photoshop when you have buttons in lots of different languages. It's also useful if you want to use a font where it's not legal to embed it. (You can generate all of your button imagery using code and localization files, then remove the embedded fonts and use the generated PNG files in the release version.)
[+] [-] saurik|14 years ago|reply
[+] [-] pornel|14 years ago|reply
And I don't get why Apple bothers with CgBi PNGs, since endian swap on ARM is a single cycle instruction, and it's probably free anyway while moving the bitmap to the GPU memory.
[+] [-] phil|14 years ago|reply
Anyway sometimes you need drawing code -- it's much more animatable, for example.
[+] [-] angerman|14 years ago|reply
The underlying idea of generating your images "programmatically" is not a bad one to start but performance wise, if the image (View) is going to be static, rendering into a bitmap and using that subsequently is the more performant solution.
Maybe the tool we are looking for is not one that generates UIViews but let's us just get the images correctly name and at the right resolutions with a click? Like automatic slicing and exporting at predefined resolutions with predefined naming schemes. I just think this would better be done off the device.
For interactive views (drag, move, ...), where redrawing is necessary, this could be a valuable tool -- if it can do that.
[+] [-] gdubs|14 years ago|reply
[+] [-] irrationalfab|14 years ago|reply
[+] [-] betageek|14 years ago|reply
[+] [-] tvon|14 years ago|reply
[+] [-] revorad|14 years ago|reply
[+] [-] jaimzob|14 years ago|reply
[+] [-] aggarwalachal|14 years ago|reply
One thing I would like to see is being able to export these vector graphics to other formats.
[+] [-] aggarwalachal|14 years ago|reply
Edit
PaintCode is a simple vector drawing app that instantly generates resolution-independent Objective-C drawing code for both Mac OS X and iOS.
You no longer have to tweak and recompile your drawing code over and over again to achieve the desired result.
[+] [-] benbjohnson|14 years ago|reply
Here's a short 5 minute walkthrough in designing the Mail app in Mockdown:
http://vimeo.com/23869680
[+] [-] supar|14 years ago|reply
Windows MetaFile contain(ed) serialized GDI graphic calls to generate the picture in a resolution independent way, while still working as a vector file format that other application could parse.
Generating static ObjC seems like a dumb idea except in very specific cases.
[+] [-] thought_alarm|14 years ago|reply
[+] [-] michaelw|14 years ago|reply
[+] [-] aggarwalachal|14 years ago|reply
[+] [-] unjinxable|14 years ago|reply
[+] [-] aggarwalachal|14 years ago|reply
Just got an email from their team
Trial version of PaintCode
You can now download a limited trial version of PaintCode at http://paintcodeapp.com/trial.html
Video guides
We've prepared 4 short video guides demonstrating PaintCode in action. These guides show various basic drawing techniques at: http://paintcodeapp.com/examples.html
Examples
You can also find examples of PaintCode documents at the same page. Some of the examples include simple Xcode projects. These projects utilize the drawing code generated by PaintCode.
[+] [-] feralchimp|14 years ago|reply
[+] [-] eduardordm|14 years ago|reply
The good: It's great. I've been looking for something like that for a while. I wish XCode could do that. If you are a serious iOS developer you will love this tool. Very useful.
The bad: Some of the code cannot be easily used, specially if you need to manipulate positions in runtime. It should use relative positions, where 0 is "somewhere" within the object. The code generated may cause some UIViews to blur, sometimes you need to round x/y.
The ugly: The price is not aligned with apps at the same level of complexity.
Buy it.
[+] [-] Flow|14 years ago|reply
Non-native UI controls everywhere. :-/
[+] [-] seanalltogether|14 years ago|reply
[+] [-] kranner|14 years ago|reply
[+] [-] joelhaasnoot|14 years ago|reply
[+] [-] 286c8cb04bda|14 years ago|reply
[+] [-] vdm|14 years ago|reply
[+] [-] sarbogast|14 years ago|reply
[+] [-] febeling|14 years ago|reply
One thing that I'm not totally sold on it that fact that it generates code though. It is not going to be the running application which you interactively tweak. Because that is what Bret was showing in his talk. And that is also what you would be doing in Smalltalk. I'm not sure this is as 'immediately connective' (to use a variant of Bret's language) as it seems.
Another approach to go about this would be to store the 'drawing' in a data structure and have a special view that takes it and puts it into an image (or on screen immediately). That would also open possibilities for caching, something that likely would be make sense, as other commenters have mentioned as well. Such an approach would come dangerously close to implementing/reinventing SVG, though. Another benefit of such a data structure would be that it could have some simple, textual representation. JSON maybe? Even XML would do. And that would greatly help with version control and diffing.
I don't see why such a feature could not be added to this app.
Amazing application.
[+] [-] dchest|14 years ago|reply
I think Opacity [1] was the first program with this feature (added in 2009 [2]).
1. http://likethought.com/opacity/
2. http://daringfireball.net/linked/2009/09/22/opacity
[+] [-] seclorum|14 years ago|reply
Haven't quite got it ready for launch yet, but rest assured the idea is not new. There have been Inkscape exporter tools for this sort of thing for years, you just have to know where to look (inkexport, &etc.)
PaintCode sure is pretty, though.
[+] [-] kenrikm|14 years ago|reply
What I'm curious about, maybe someone here has the answer is if there would be a significant performance gain from using Core Graphics over just loading a PNG?
[+] [-] cwbrandsma|14 years ago|reply
Conventional wisdom, especially for small images, it is much more efficient to draw them with Core Graphics than use a image, more so if there is transparency in the image.
This will even be true for non-ios systems. Microsoft has said for years, that generating a 16x16 image is faster than getting it from disk (depending on complexity and disk speeds).
Plus, code does tend to be more compact (again, within reason), so it is less that has to be loaded when your application starts.
[+] [-] randomdata|14 years ago|reply
Only if you're willing to release an update. There's something to be said about having it already ready for any future resolutions, now.
[+] [-] chj|14 years ago|reply
[+] [-] nupark2|14 years ago|reply
[+] [-] nudded|14 years ago|reply
[+] [-] aggarwalachal|14 years ago|reply
[+] [-] chriseidhof|14 years ago|reply