Showing posts with label image processing. Show all posts
Showing posts with label image processing. Show all posts

Monday, July 18, 2011

Glass Button Generator

Was looking for ways to draw those nice glass buttons on the net, found this link from Anders Brownworth which not only generates a beautiful glass button, it also saved it as a .PNG file which you can then re-use in the future, which is pretty cool!

Played around with it a bit, and added some looping and tried to covered lots of colours (colorWithHue accepts value from 0 to 1 only)  and when executed will almost fill up the screen with glass buttons in different colours as shown below. Now I didn't spend lots of time in the calculation to make sure it covers all of the numbers, so you are welcomed to adjusted the parameters to different sizes and colours.

Also, before you run the code, please be aware that the following line controls where should all the image buttons be saved/written to your local drive and you should change it according to your system.


tmpStr = [tmpStr stringByAppendingFormat:@"/Users/qq/tmp/testButton%d_%d.png",ii,jj];


Then you will see lots of nice glass button files ready to be re-used in other projects.

Have fun!

Source for Glass Button image Generator

Wednesday, July 13, 2011

Better "TestingScratchTicketEffekt" project than mine

Had a quick look at that http://buildingmyworld.wordpress.com/ link I mentioned in previous post.

As below, it works like magic! First it shows this full screen covered in orange colour. If you move your finger/mouse pointer around, it will "scratch" off the orange colour and reveal the nice Apple image below.

The source code is also available on that blog. Thanks for the sharing and it's definitely much better than mine. The best part is - everyone knows how to do it now, ha ha!

Image Mask Test Project

As mentioned in this post on iPhone Dev SDK forum, there's this discussion about how to create a dynamic mask. Where a mask layer is presented above another photo layer and when user moves his/her finger on it, the photo below will be revealed.


This sounds like an interesting project, although have to admit it's far beyond my level of objective-c skills..... Did some research and found 2 links:
http://www.iphonedevsdk.com/forum/245649-post15.html
http://www.ifans.com/forums/showthread.php?t=132024

which gave me some idea. I sort of combined the two and created a small project with "similar" effect. Unfortunately I don't know how to "fill the whole screen with a solid colour" yet (yes it's a bit embarrassing...), so I sort of do it in a slightly different way.

As shown below, when the project starts, it shows the full image, then user starts moving finger to draw something (this mimics the fill up full screen with solid colour part :-P ). After that, click on "switch" to switch to "erase" mode, and the then when user moves finger around, the red paint get erased and revealed the photo below.....

Ok, I agree this is not exactly what the original request is asking for, but I guess if somehow i can work out how to fill up the full screen with some colour, I can just start with the "erase" mode and that should be quite close to the original request.... Leave this for future project then.

[UPDATE] See this post about info from analysing source code from the site http://buildingmyworld.wordpress.com/ which has better solution than mine.

Source for Image Mask Test Project