How to implement a gradient color picker in code? - graphics

I'm wanting to program something like Photoshop's gradient color picker. I've been googling but can't find anything. Do you guys know how to do it?

It's a bit out of date (and .NET if that's your choice of framework), but in the past I've implemented an app with this ColorPicker.

I remember hacking up something like it with a static image and getPixel.

Related

Axes on image in IDL

I have an image displayed in an IDL window using the TV command, and would like to add x and y axes to the image. Seems straightforward, but I can't find a way to do it.
Can anyone help with this?
Thanks
Are you tied to direct graphics, i.e., TV? Easiest way to display with axis is to use IMAGE function:
im = image(arr, axis_style=1)
I would echo Mike's answer - go with the new graphics Image function if possible.
If you absolutely have to use direct graphics, then I would recommend using David Fanning's coyote graphics wrappers:
http://www.idlcoyote.com/idldoc/cg/cgimage.html
It's still a lot more work to do this using direct graphics, but at least with the "cg" commands it's easier.

Advanced CSS Circles

I'm trying to make 3 different circles to my website. I don't want to insert it as a graphic/image file. So I've been trying to achieve it using CSS3, but I can't really work my fingers around it.
What will it look like?
I have uploaded a picture of what I'm trying to achieve at: www.sp34k.com/etc/circles.jpg
I can't really show the code I've been trying to use to achieve this, as it all looks totally weird and nothing floats currectly.
What I've tried
What I've tried is to make 3 circles with position absolute and then use % (percentage) to determine the width of the colored parts, but I can't twist my mind around how it should be set up.
Any suggestions is appreciated,
Mike
Here is a simple try of me to achieve the effect you want:
DEMO
edit: css-only solution
It can be easily animated with javascript or keyframes. Arbitrary content would go into the inner div. To change the percentage, simply adjust the angle of the pseudo-elements.
With a little more effort this could be easily refined I guess;)
Note: the transform has the webkit-prefix, so it works only in chrome/safari - to see it in firefox or other browsers, you need to change the prefix.
P.S. I will animate it when I'm home from work.
Good one by Christoph but he is using SASS/SCSS which are comparatively slow then normal CSS because they have to be converted to CSS before browser render it so I have have a different Solution for you
try this fiddle

Edit image, using openGL

I have been doing some searching the last couple of days and I have been curious how to do this. I have a UIImagePickerController.
So I want to add a effect like black and white, sepia, etc. I am creating a custom UIImagePickerVController and I am curious. Can this be done with OpenGL ES? If so, how?
This is possible through the use of pixel shaders using OpenGL-ES 2.0. You could also write an Objective-c++ routine that gets all the pixels of your image into an array then applies a custom algorithm to modify the color of the image.
Edit:
Here are some links that might help get you started.
http://www.sunsetlakesoftware.com/2010/10/22/gpu-accelerated-video-processing-mac-and-ios
http://www.dreamincode.net/forums/topic/76816-image-processing-tutorial/
http://www.efg2.com/Lab/Library/ImageProcessing/Algorithms.htm

underlining text in sifr

I've recently been getting into using sifr as a healthy alternative to generating text as image using php. I've got a question about underlining text, for a website design I need to be able to specify the thickness of the underline and the distance from the text, is there any way to accomplish this with sifr? If not, is there a way to be able to solve this with css? I've been trying to get my head around it, but since I haven't found a way to get the exact width of the sifr text, I'm doubting whether it's possible at all.
Any thoughts on this? They're much appreciated.
Kind regards,
Thijs.
I suspect that Flash renders a fake underline, and no, you can't change how it looks. The only option would be to render a border underneath the Flash movie using HTML & CSS, but I don't that'll work very well.
With sIFR 3, if you specify the fitExactly: true option in the replacement, the Flash movie will be the same width as the internal text.

Preventing Color Bleed when using Graphics.Drawstring()?

How do I prevent colors form bleeding into one another when using the vb .net Graphics.Drawstring method. This Occurs with colors that really shouldnt be used together eg green/orange and black and red.
Thanks
Sounds like you have antialiasing enabled. Have you tried to disable that?
I fixed this by generating png's instead of jpegs the quality ended up being a lot better

Resources