Rotating a UIButton? - xcode

I am trying to rotate a UIButton so it looks more like a diamond instead of a square. I have searched a lot on the site and could not find anything that could help me. I am having a lot of trouble with this and need some help. I think it will increase the appeal of my app when it is running. This is a problem I have had for a while and have been struggling with so anything can help me. I don't know if this is a built in feature in Xcode or if I need to do this programmatically.
Any suggestions would be greatly appreciated.
Thanks in advance.

You could simply apply an affine transform to the button. Something like this:
import Darwin
...
myButton.transform = CGAffineTransformMakeRotation(M_PI/2)
However, that will rotate the entire button, including the title. If that's not what you want then it gets more complicated.

Related

create a simple (and visible!) UI slider in Unity 5

![enter image description here][1]please I need some help, this should apparently be something very simple and basic to do, but maybe I'm missing something.
I'm quite newbie to Unity3d, I had no much problem with creating a somewhat flashy 2.D scene (I mean 2D with different layers in Z level), scripts, etc. But I'm having trouble to create a "UI Slider" object: when I create it, it just shows nothing on screen. How can I make it visible? I just need to create a very simple, plain slider whose value can be controlled at runtime by means of a script.
thanks.
Well.. since you give nothing to go on, I suggest that you take a look at a tutorial for the UI:
https://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/using-the-ui-tools
If you have troubles after this tutorial, come back with an example of your problem to make people more willing to sacrifice their time in helping you.
Hope this is somewhat useful
Take a look at the Unity3D docs here.
http://docs.unity3d.com/Manual/script-Slider.html
It should have what you are looking for.

Dynamically(at some time intervals) change textures on a plane/cube in three.js?

I know it's something with texture.needsUpdate() while rendering but I don't have a clue how to actually implement it. Maybe someone knows a link where I can see a working example or post some piece of code? Cheers.
An excellent question; I created some sample code to do exactly this -- using a spritesheet to do some 2D animation on a plane and on a cube, which requires regular updates. Here is a link to a documented example, that in particular contains a function to do exactly what you need.
http://stemkoski.github.com/Three.js/Texture-Animation.html
Hope it helps!

How to locate position/coordinates of faces in photo through code?

I know about face.com and its cool API. But it only identifies the people in the photo. I really dont need that. I want to able to detect the position (as in x,y,width and height) of face(s) in a given 2d photo. If anyone know of an ongoing project, of available projects, please help me out with some links, tips and or advice. Deeply appreciate that. Thanks
Use OpenCV Face detector. It gives x,y,width,height

How to find all the colors in a photo with Ruby

Does anyone know of a Ruby library that can list all of the colors in a photo, as well as listing them in order of frequency? Or is it possible that RMagick already can do something like this?
If no one knows of one, how exactly could I get started on making such a tool? I have a great idea for a program I'd love to try, however I just don't know much about image processing as I've never done it.
I'd be very grateful for any tips or info to point me in the right direction! Thanks!
color_histogram

Qt: transparent QRubberBand?

I'm trying to draw a QRubberBand on a QGLWidget. For some reason the area of the rubber band is drawn as opaque and I don't see what's behind it. This kinda beats the purpose of the rubber band as a way to select stuff inside it.
I've seen in docs for QStyleOptionRubberBand that there's an 'opaque' member but I have no idea how to access this in the default style or how to change it.
Anybody ever done this?
Are you in Vista/Win7 with Areo on? If so, does it work when you turn it off?
EDIT:
How about Message #6?
"In the meantime I looked it up in the QT source code, and I noticed that the following will solve my problem: myQRubberBand->setWindowFlags(Qt::ToolTip);"
It would be great having any source code ?
But here are how I would attempt to fix the problem :
Subclass QRubberBand
Redefine PaintEvent method
call iniStyleOption to activate style options of your choice
Hope it helps !

Resources