[iPhone SDK] Get pixel color

In OS X you can use NScolor Getcolor X Y to get the color of a specific pixel in a given image but this does not seem to be in the framework for the iPhone. Does anyone know how to do this?
thanks in advance
Dave

Hello  C.H.Chi
This code might solve your problem.
public partial class Form1 : Form
public Form1()
InitializeComponent();
Bitmap myBitmap;
private void Form1_MouseMove(object sender, MouseEventArgs e)
Color pixelColor = myBitmap.GetPixel(e.X, e.Y);
this.Text = pixelColor.ToString();
private void Form1_Load(object sender, EventArgs e)
myBitmap = new Bitmap(Properties.Resources.Tulips);
place a image in your resource file and access from their.
Kindly mark as answer if found useful.

Similar Messages

  • Get pixel color on screen

      What function do I use to get pixel color of screen
    ChangChiTheGraphics
    chang Chi

    Hello  C.H.Chi
    This code might solve your problem.
    public partial class Form1 : Form
    public Form1()
    InitializeComponent();
    Bitmap myBitmap;
    private void Form1_MouseMove(object sender, MouseEventArgs e)
    Color pixelColor = myBitmap.GetPixel(e.X, e.Y);
    this.Text = pixelColor.ToString();
    private void Form1_Load(object sender, EventArgs e)
    myBitmap = new Bitmap(Properties.Resources.Tulips);
    place a image in your resource file and access from their.
    Kindly mark as answer if found useful.

  • Web applet to get pixel color

    I know nothing about java, but I 'll learn if I need. But first, I need to know if a java web applet can do the goal I need:
    A java web applet that can pass a specific pixel color on the browser windows to javascript. The coordinates of that pixel will stay outside the own applet borders.
    I don't know if this is the right forum, so can you please help me in any way?
    Thanks a lot.
    Julio Morales.

    juliochile wrote:
    I know nothing about java, but I 'll learn if I need.
    But first, I need to know if a java web applet can do the goal I need:Fair enough
    A java web applet that can pass a specific pixel color on the browser windows to javascript. Yes this can be done, but as I recall it was somewhat of a pain. It will also be browser-specific. If you ask me the requirement is probably flawed.
    The coordinates of that pixel will stay outside the own applet borders.Huh? So you need to sample a pixel? This post makes little sense. Post the exact use case. Way too vague.

  • Get pixel  color

    hello,
    if u know how to retrieve the pixel color of any specified coordinate pixel
    ,say (x,y) please let me know ,i ll be thankfull to u.

    hello,
    if u know how to retrieve the pixel color of any specified coordinate pixel
    ,say (x,y) please let me know ,i ll be thankfull to u.

  • Get pixel  color in J2ME

    hello,
    if u know how to retrieve the pixel color of any specified coordinate pixel
    ,say (x,y) of a canvas please let me know ,i ll be thankfull to u.

    you can try to create a new image and paint on that image.
    Image img = new Image( yourcanvaswidth, yourcanvasheight );
    yourcanvas.paint( img.getGraphics() );
    int [] rgbs = new int[  yourcanvaswidth, * yourcanvasheight ];
    img.getRGB( rgbs, 0, yourcanvaswidth, 0, 0, yourcanvaswidth, yourcanvasheight );
    the rgbs holds RGB values of you canvas.
    hope this will help

  • [iPhone SDK] Get the *intended" contentOffset in UIScrollViewDelegate calls

    Hi all,
    a lot of the delegate calls in UIScrollViewDelegate happen before the scrolling is finished, like:
    - (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView;
    - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate;
    When I'm in these functions, the UIScrollView is still moving to its intended contentOffset. However, the contentOffset property only returns to me the current offset. Is there other property I can look for that tells me the intended offset that the UIScrollView is animating to?
    If not, anyone know if a way I can calculate this?
    Thanks!
    Message was edited by: rizwansattar04
    Message was edited by: rizwansattar04

    You would need to ask this over at devforums.apple.com. These forums are for regular users of the iPhone rather than developer questions.

  • I have an IPhone 4S. My color pictures and all icons have lost their color. How do I get the color back? Did I touch a wrong button?

    I have an IPhone 4S. All my color pictures and icons turned to looking like a negative.  No color! How do I get the color back on my phone?

    Hi ladwwd56,
    Welcome to the Support Communities!
    Is it possible that you may have an Accessibility feature called "White on Black" turned on?
    See page 244 of the iPhone User Guide PDF:
    http://manuals.info.apple.com/MANUALS/1000/MA1539/en_US/iPhone_iOS4_User_Guide.p df
    White on Black
    Use White on Black to invert the colors on the iPhone screen, which may make it easier to read the screen. When White on Black is turned on, the screen looks like a photographic negative.
    Invert the screen’s colors: In Settings, choose General > Accessibility and tap the “White on Black” switch.
    If that is not the case, try restarting / resetting the iPhone:
    iOS: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/HT1430
    If that does not resolve the issue, refer to page 146 in the iPhone User Guide to Reset All Settings:
    iPhone User Guide for iOS 7
    manuals.info.apple.com/MANUALS/1000/MA1565/en_US/iphone_user_guide.pdf
    Happy New Year!
    - Judy

  • Please Help Get a Color from Pixel !!!!

    Is anybody know how to get a Color from pixel.
    My program is not Full Screen .
    So i think Robot.getPixelColor() don't suitable.
    Please Help me!

    Robot.getPixelColor() will work fine, but the problem you will have is getting the mouse set to the correct location and getting your application to know where it is: you can do it with win32 calls and JNI. Here are a few that I have found helpful--they are in a VB format:
    Public Const CLR_INVALID = &HFFFF 'not a valid pixel
    Public Const MOUSE_MOVED = &H1
    Public Const MOUSEEVENTF_ABSOLUTE = &H8000 ' absolute move
    Public Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down
    Public Const MOUSEEVENTF_LEFTUP = &H4 ' left button up
    Public Const MOUSEEVENTF_RIGHTDOWN = &H8 ' right button down
    Public Const MOUSEEVENTF_RIGHTUP = &H10 ' right button up
    Public Const REQUEST_LEFT_CLICK = &H2D 'request left click "-"
    Public Const REQUEST_RIGHT_CLICK = &H2B 'request right click "+"
    Type POINTAPI
    x As Long
    y As Long
    End Type
    Type POINTSTRUCT
    hwnd As Long
    hdc As Long
    ptAbsolute As POINTAPI
    ptOrigin As POINTAPI
    ptLocal As POINTAPI
    ptColor As Long
    sType As String
    retMessage As Boolean
    End Type
    Declare Function GetCursorPos _
    Lib "user32" (ByRef lpPoint As POINTAPI) _
    As Long
    Declare Function SetCursorPos _
    Lib "user32" (ByVal x As Long, ByVal y As Long) _
    As Long
    Declare Sub mouse_event _
    Lib "user32" (ByVal dwFlags As Long, _
    ByVal dx As Long, _
    ByVal dy As Long, _
    ByVal cButtons As Long, _
    ByVal dwExtraInfo As Long)
    Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    Declare Function GetMessageExtraInfo Lib "user32" () As Long
    Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, _
    ByVal x As Long, _
    ByVal y As Long) As Long
    Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, _
    ByVal yPoint As Long) As Long
    Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
    Declare Function GetWindowOrgEx Lib "gdi32" (ByVal hdc As Long, _
    ByRef lpPoint As POINTAPI) As Long

  • Get the color of a pixel in an image

    how can i do to get the color of a pixel in an image ???
    Can anyone help me ?

    Hi,
    first of all you need to get the library to transfer your image to java.awt.image.BufferedImage object.
    I know many such libraries. Its depends of what kind of image you have: jpeg, gif, png or other.
    And when you get the BufferedImage of you picture using library, then you can get the color of any pixel in image using int BufferedImage.getRGB(int x, int y) as integer value.
    Victor Letunovsky

  • Get the color of a pixel on the Stage

    Is there a way to retrieve the color of a generic pixel on the screen using the mouse pointer inside the Stage of Flash Player? With the getPixel method of the BitmapData class you can get the color of a pixel only if the mouse is over a bitmap image, but what if I need the color a generic pixel on the screen?

    this takes a snapshot of the pixel below the mouse:
    function eventHandler(event:MouseEvent):void
         var bmd:BitmapData = new BitmapData(1, 1, false, 0x000000);
         var matrix:Matrix = new Matrix();
         matrix.translate(event.stageX, event.stageY);
         //can never remember which way translate works so it could be:
         //matrix.translate(-event.stageX, -event.stageY);
         bmd.draw(stage, matrix);
         var pixelColour:uint = bmd.getPixel(0, 0);
    my blog has more info: http://blog.leeburrows.com/2010/09/bitmapdata-basics-1/

  • Getting started with the iPhone SDK

    Ok, so I downloaded the iPhone SDK to my Macbook Pro and installed it. When I go into the Developer folder I can find an xcode program, version 3.1, but I can't find how to get an IDE environment running to start writing code in. In short I'm new to the Mac platform and could do with some help getting started writing code for the Mac/iPhone platform. Can anyone point me in the direction of a good tutorial to get me going?
    (btw, I program in other languages on other platforms so I understand programming and its concepts, just not specific to a Mac ;D )

    http://developer.apple.com
    There are some good basic tutorials about XCode and then some good videos in the iPhone section

  • IPhone SDK:  What are my options for getting help?

    I am an experienced programmer, but new to the mac and iphone. I've installed the sdk, but am not able to build the sample programs. I see from this forum that others have had the same problem, but I don't see an answer. I understand that there are many helpful people on this forum, but what do I do if I can't get my question answered? Should I spend the $99 to enroll and be able to get an answer?
    BTW, my question is about not being able to target the iphone or simulator, and getting an "ibtool cannot open files of this type" error, even though I've installed the iphone and simulator sdks. More at http://discussions.apple.com/thread.jspa?messageID=8559012.
    I appreciate any help, whether it's with my build problem or advice on where I should turn to for help.

    gvsguy wrote:
    Should I spend the $99 to enroll and be able to get an answer?
    If you're really using a G5 iMac, I doubt you'll get much help from Apple. The iPhone SDK is only supported on Intel Macs, so they probably wouldn't be able (or not very willing) to help. Google is more likely to be helpful, assuming someone has found a way to use the iPhone SDK on PPC Macs at all.
    charlie

  • Getting the Color of a Pixel in a Image

    Hi. I need to get the Color of the point in an Image (or ImageIcon). I've seen examples but they use BufferedImages.
    Thanks, Bob

    Here is a simple conversion for you:
    BufferedImage bi = new BufferedImage(myImage, myImage.getWidth(null), myImage.getHeight(null), BufferedImage.TYPE_INT_RGB);
    Graphics g = bi.getGraphics():
    g.drawImage(myImage, 0, 0, null);If you are using ImageObserver objects, then replace null with the corresponding ImageObserver object in the BufferedImage and drawImage.

  • Learning iPhone SDK - Trying to draw an image

    Although I have programmed for Mac in the last years, I have never used Mac-specific technologies as Cocoa (I have programmed more in OpenGL, SDL, and the like).
    Now I am getting started with the iPhone SDK. I'd like to do some OpenGL|ES stuff, but since it is not supported in the Simulator, and you need to join the Developer Program to test stuff on directly on the device (and admission of new members is closed right now), I am focused on other stuff right now, like using Core Graphics for drawing images on the iPhone.
    My application is based on the Cocoa Touch Application template. I left the default code except for a few changes.
    In file "UntitledAppDelegate.m", I have changed the method applicationDidFinishLaunching to:
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    contentView = [[[MyView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];
    [window addSubview:contentView];
    [window makeKeyAndVisible];
    Then, in the MyView interface file (MyView.h), I have added the attribute "UIImageView* image;" to the class, which is declared as a property, and synthesized.
    In the class implementation (MyView.m), I have changed the method initWithFrame to:
    - (id)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
    self.backgroundColor = [UIColor darkGrayColor];
    image = [self loadImageView:@"box01.png"];
    [self addSubview:image];
    return self;
    loadImageView is a private method I have implemented as:
    - (UIImageView *)loadImageView:(NSString *) imageName {
    UIImage *img = [UIImage imageNamed:imageName];
    UIImageView *theView = [[UIImageView alloc] initWithImage:img];
    return theView;
    Since I have loaded the UIImage, and initialized a UIImageView with it, and the image view is added as a subview of the main view attached to the window, I thought it should be everything needed to draw an image on the screen. But nothing is visible. The screen is simply black when I run this on the Simulator. It doesn't even set the background to dark gray.
    So I need some help with this, I sure that anyone with experience in Mac programming will know how to help me.
    Thank you in advance.
    Message was edited by: Jedive

    I removed the XIB file from the project, but that didn't help. It was a problem with my inexperience with Objective-C. When accessing class properties in a method of the same class, i was not putting "self." before the property (in C++ that's redundant). For example, in the line "window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];". After adding it, it works correctly.

  • I have a video in excellent quality (1280x720 23,976 fps) I burn the dvd in encore cs6 with hd menu and I get pixelated.   I've done transcoding but It downgrade to 480   I need urgent help.

    I have a video in excellent quality (1280x720 23,976 fps) I burn the dvd in encore cs6 with hd menu and I get pixelated.   I've done transcoding but It downgrade to 480   I need urgent help.

    Hi,
    first, sorry if my english sucks jajaa i speach spanish, havent practice my english for a while.
    first i edited my video in premier cc
    sequence 1280X720, 59,94 fps
    48000hz - stereo
    the i linked it with dynamik link to after, make some color correction, etc etc etc
    i renderd in quicktime animation
    my video looks fine in my computer, but when i send my .mov video to encore (cs6) in a HD MENU and standard menú, the image sucks.
    i have done the transcoding in encore, but i doesnt work either. i dont know what else to do.

Maybe you are looking for

  • Unable to login to my WindowsPC after installing new iTunes version 7.4.3.1

    Hi all, I just received an alert saying a new version of iTunes was available and I went ahead and installed it. After the install the system prompted me to restart. I did the restart and now I am unable to log back into the system. I tried my local

  • Qosmio G10-133 has no sound

    Hi just new to forum so bare with me. Bought my g10 recently and carried out system restore as instructed on update documents: 1 product recovery cd-rom 2 qosmioplayer recovery cd-rom 3 qosmioplayer update cd-rom 4 qosmio update cd-rom. Notebook has

  • Best choice for a date column in forms

    Hello, I want to know what is the best choice for a date field that the user have to enter manually. I read on a other post that a calender control is not directly implemented in forms 9i. So what is the best choice to be "user friendly" with a date

  • UTL_FILE Oracle training sessions

    I'm working on writing a pl/sql package to read the flat file, parse the data and load it into the table using UTL_FILE.fopen, DBMS_LOB.OPEN. I'd like to take some sessions related to this topic if Oracle training center conduct. Can someone suggest

  • Indesign CC crashing when relinking

    I have been using Indesign CC for a month or two now and for some reason it just started crashing when I try and relink a file in a publication I'm working on. It has worked fine up until this point. Any suggestions? I have already tried reinstalling