Search Results

Search found 4528 results on 182 pages for 'touch'.

Page 14/182 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • How to get pixel data from a UIImage (Cocoa Touch) or CGImage (Core Graphics)?

    - by Olie
    I have a UIImage (Cocoa Touch). From that, I'm happy to get a CGImage or anything else you'd like that's available. I'd like to write this function: - (int)getRGBAFromImage:(UIImage *)image atX:(int)xx andY:(int)yy { // [...] // What do I want to read about to help // me fill in this bit, here? // [...] int result = (red << 24) | (green << 16) | (blue << 8) | alpha; return result; } Thanks!

    Read the article

  • Checking if a touch is withing a UIButton's bounds.

    - by Joshua
    I am trying to make an if statement which will check whether the users touch is within a UIButton's bounds. I thought this would be an easy affair as UIButton is a subclass of UIView, however my code doesn't seem to work. This is the code I have been using. - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { NSArray *array = [touches allObjects]; UITouch *specificTouch = [array objectAtIndex:0]; currentTouch = [specificTouch locationInView:self.view]; if (CGRectContainsPoint(but.bounds, currentTouch)) { //Do something is in bounds. } //Else do nothing. }

    Read the article

  • Checking if a touch is within a UIButton's bounds.

    - by Joshua
    I am trying to make an if statement which will check whether the users touch is within a UIButton's bounds. I thought this would be an easy affair as UIButton is a subclass of UIView, however my code doesn't seem to work. This is the code I have been using. - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { NSArray *array = [touches allObjects]; UITouch *specificTouch = [array objectAtIndex:0]; currentTouch = [specificTouch locationInView:self.view]; if (CGRectContainsPoint(but.bounds, currentTouch)) { //Do something is in bounds. } //Else do nothing. }

    Read the article

  • Multitouch script (using xinput) no longer working

    - by Pitto
    #!/bin/bash # # list of synaptics device properties http://www.x.org/archive/X11R7.5/doc/man/man4/synaptics.4.html#sect4 # list current synaptics device properties: xinput list-props '"SynPS/2 Synaptics TouchPad"' # sleep 5 #added delay... xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 8 1 xinput --set-prop --type=int --format=32 "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Pressure" 4 xinput --set-prop --type=int --format=32 "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Width" 9 # Below width 1 finger touch, above width simulate 2 finger touch. - value=pad-pixels xinput --set-prop --type=int --format=8 "SynPS/2 Synaptics TouchPad" "Synaptics Edge Scrolling" 1 1 0 # vertical, horizontal, corner - values: 0=disable 1=enable xinput --set-prop --type=int --format=32 "SynPS/2 Synaptics TouchPad" "Synaptics Jumpy Cursor Threshold" 250 # stabilize 2 finger actions - value=pad-pixels #xinput --set-prop --type=int --format=8 "SynPS/2 Synaptics TouchPad" "Synaptics Tap Action" 0 0 0 0 1 2 3 # pad corners rt rb lt lb tap fingers 1 2 3 (can't simulate more then 2 tap fingers AFAIK) - values: 0=disable 1=left 2=middle 3=right etc. (in FF 8=back 9=forward) xinput --set-prop --type=int --format=8 "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Scrolling" 1 0 # vertical scrolling, horizontal scrolling - values: 0=disable 1=enable #xinput --set-prop --type=int --format=8 "SynPS/2 Synaptics TouchPad" "Synaptics Circular Scrolling" 1 #xinput --set-prop --type=int --format=8 "SynPS/2 Synaptics TouchPad" "Synaptics Circular Scrolling Trigger" 3 Hello everybody... The above script allowed me to use happily multitouch for a month... Now if I do a two fingers scrolling the mouse cursor just runs on the screen like possessed... Any hints?

    Read the article

  • Identify which CCSprite is touched in Cocos2d

    - by PeterK
    I am trying to learn Cocos2d and is experimenting with Ray Wenderlich tutorial whack-a-mole: www.raywenderlich.com/2560/how-to-create-a-mole-whacking-game-with-cocos2d-part-1 In this tutorial three CCSprite's are popping up and you should click on them... However, i am trying to identify which mole, rat in my case, is popping up and place a CCSprite above that. Initially this looked like an easy task but i am failing. I am trying to NSLog LEFT HIT. i would guess the problem is in the If-statement and the last "227" height parameter. The left rat boundingBox = {{99.5, 146.5}, {165, 227}} (from NSLog). The key code is in the ccTouchBegan function: -(BOOL) ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event { CGPoint touchLocation = [self convertTouchToNodeSpace:touch]; for (CCSprite *rat in rats) { if (rat.userData == FALSE) continue; if (CGRectContainsPoint(rat.boundingBox, touchLocation)) { //left: rat boundingBox = {{99.5, 146.5}, {165, 227}} //mid: rat boundingBox = {{349.5, 146.5}, {165, 227}} //right: rat boundingBox = {{599.5, 146.5}, {165, 227}} //>>>>Here is where i try to get a hit<<<< if (CGRectContainsPoint(CGRectMake(99.5, 146.55, 165, 227), touchLocation)) { NSLog(@">>>>HIT LEFT<<<<<"); } I would really appreciate a few ideas how to get this to work.

    Read the article

  • Nexus 7 Possibly Bricked

    - by user214186
    I have a 1st gen Nexus 7 (32GB). I used the steps at https://wiki.ubuntu.com/Nexus7/Installation to successfully install Ubuntu 13.04 desktop onto the tablet. It was working fine and then I decided to upgrade to Ubuntu Touch. I booted the tablet into fast boot mode but the commands 'adb devices' and 'sudo fastboot devices' would not see the device. I am performing these steps from an Ubuntu 12.04 desktop PC. Prior to installing 13.04 the device was seen fine. I made the mistake of performing the 'Device factory reset' step from https://wiki.ubuntu.com/Touch/Install - Step 2. Now when I try to boot the device I get the following: mount: mounting /dev on /root/dev failed: no such file or directory mount: mounting /dev on /root/sys failed: no such file or directory mount: mounting /proc on /root/proc failed: no such file or directory Targe filesystem doesn't have requested /sbin/init. No init found. Try passing init= bootarg. BusyBox v1.20.2 (Ubuntu 1:1.20.0-0ubuntu1) built-in shell (ash) Enter help for a list of built-in commands. (initramfs) I have searched the web but every reference to this problem is from people who still have ADB access to the device so they can recover by flashing the tablet again. I can attach a keyboard to the USB port and access the BusyBox console but I don't know what steps to do to recover from my error. Any suggestions would be helpful. Thanks

    Read the article

  • issues with ASUS S301L ultrabooks

    - by Wuerze
    I just like to tell you what still is a Problem in Ubuntu 14.04 and should be solved for a nice experience of this distribution. Unfortunately I do not have any hints to tell you, because I am just a user and know not much about programming. Anyway, I hope it helps. 1) Intel open source Graphics issues (proprietary) -when attaching HDMI-cable the screen switches to the external monitor and it's fine, but there is no switching back unless restart with HDMI deattached -black screen appears for like 2 seconds as if I would change screen in the settings; frequency increases with intensity of driver use (i.e. videos or video games) 2) hotkeys (commonly recognised) -there is no possibility to adjust brightness with the hotkeys (Fn+F5 and Fn+F6) 3) touchscreen (commonly recognised) -the touchscreen is behaving like a mouse -configuring gestures for the multi touch screen seems to always end in disabling touch pad gestures 4) panel symbols -battery symbol has got a low accuracy while it determines accurately the energy left; only 5 steps of energy are shown by the symbol Thank you all for participating in the solution of these problems! I will stay tuned and edit this list if something has been solved.

    Read the article

  • Can't get utouch to show available wifi networks

    - by kellrobinson
    I have ubuntu touch installed on a 2014 Nexus 7. Swiping down from the wireless symbol reveals a "Network" menu with the choices Flight Mode, Wifi Settings, and Cellular Settings. Wifi Settings leads to another menu: Previous Networks, and Other Networks. Previous Networks shows a list of networks used in the past; Other Networks opens an empty box for typing in the name of a network. I don't see any way to show a list of available networks detected by the device. On rare occasions, swiping down the wireless symbol actually does bring up a list of detected networks. But most of the time ubuntu touch exhibits the behavior described above, with no apparent way to bring up the list of available wireless networks. I would like to see a list of the availble networks, if there is a way to do so. Edit: The wifi menu works properly now. Just needed a couple of reboots, it seems. I have other problems, though. If these other problems persist I will make a post specific to them. This device is a 2013 Nexus 7 4G. Not sure how to find the ubuntu version. Can't navigate the settings menu right now because it got stuck and there's no way to go back, except to reboot(!) I'll open multirom manager or boot into recovery and look for the information there.

    Read the article

  • Need multiple views to respond to a touch event in an iPhone app

    - by Joel
    Setup: I have two views that I need to respond to the touch event, and they are layered out on top of one another. View 1 is on top of View 2. View 2 is a UIWebView. View 1 is sublclassed to capture the touch event. My problem is that if I try to call the UIWebView event handlers (touchesBegan: and touchesEnded:) from within the event handlers of View 1, which is the first responder, nothing happens. However if I set View 1 to userInteractionEnabled = NO, then the touch goes through that view and is processed properly by the 2nd view. Any ideas on how I can have 2 views respond to a touch event? Unfortunately the 2nd view is a UIWebView, so I need to actually call the event handler and not a different method, etc... Thanks in advance for any advice, Joel

    Read the article

  • Drag Rotate UIImageView by touch

    - by rockstardev
    I have an UIImageView that is a subview of an UIView. I'm trying to create a drag rotate effect with the UIImageView similar to spinning a bottle but I'm having trouble calculating the radians to rotate the image by. My code below seems like it should work because I've seen a similar calculation in Flash examples. Can anyone shed some light on what I'm doing wrong? Thanks. This is the code contained in my image view subclass: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; lastLocation = [touch locationInView:[self superview]]; } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; CGPoint location = [touch locationInView:[self superview]]; CGFloat xDisplacement = location.x - lastLocation.x; CGFloat yDisplacement = location.y - lastLocation.y; CGFloat rad = atan2f(yDisplacement,xDisplacement); self.transform = CGAffineTransformMakeRotation(rad); }

    Read the article

  • WMI: How to differentiate between Wireless mouse and touch screen

    - by kingas
    I am using Win32_PointingDevice class to detect mice connected to the system. I ran my device discovery script on a machine which has touch screen. The discovery shows up with 3 pointing devices, directly connected USB mouse, wireless mouse and touch screen. My question is how to distinguish between USB mouse with touch screen. If Win32_PointingDevice class doesn't provide information then are there any other methods which I can use to get mouse and touch information. This is extension to my previous question at http://stackoverflow.com/questions/1746689/wmi-class-for-wireless-mouse

    Read the article

  • Sencha Touch 2 - Can't get list to display // or load a store? [UPDATED X2]

    - by Jordan
    I have been trying to get a list to display for quite a while now. I have tried all sorts of tips from various people without success. Now I am running into a new problem. I have taken the exact code from an example and I can't seem to get it to work either. First of all, here is the code. Station.js Ext.define('Syl.model.Station', { extend: 'Ext.data.Model', config: { fields: [ { name: 'id', type: 'string' }, { name: 'stop', type: 'string' } ] } }); Stations.js Ext.define('Syl.store.Stations', { extend : 'Ext.data.Store', requires: ['Syl.model.Station'], id: 'stations', xtype: 'stations', config : { model : 'Syl.model.Station', //storeId: 'stationsStore', autoLoad : true, //sorters: 'stop', /* proxy: { type: 'ajax', url: 'stations.json' }*/ data: [ { "id": "129", "stop": "NY Station" }, { "id": "13", "stop": "Newark Station" } ] } }); MyService.js Ext.define('Syl.view.MyService', { extend: 'Ext.Panel', xtype: 'stationsformPage', requires: [ 'Syl.store.Stations', 'Ext.form.FieldSet', 'Ext.field.Password', 'Ext.SegmentedButton', 'Ext.List' ], config: { fullscreen: true, layout: 'vbox', //iconCls: 'settings', //title: 'My Service', items: [ { docked: 'top', xtype: 'toolbar', title: 'My Service' }, { [OLDER CODE BEGIN] xtype: 'list', title: 'Stations', //store: 'Stations', store: stationStore, //UPDATED styleHtmlContent: true, itemTpl: '<div><strong>{stop}</strong> {id}</div>' [OLDER CODE END] [UPDATE X2 CODE BEGIN] xtype: 'container', layout: 'fit', flex: 10, items: [{ xtype: 'list', title: 'Stations', width: '100%', height: '100%', store: stationStore, styleHtmlContent: true, itemTpl: '<div><strong>{stop}</strong> {id}</div>' }] [UPDATE X2 CODE END] }, ] } }); app.js (edited down to the basics) var stationStore; //UPDATED Ext.application({ name: 'Syl', views: ['MyService'], store: ['Stations'], model: ['Station'], launch: function() { stationStore = Ext.create('Syl.store.Stations');//UPDATED var mainPanel = Ext.Viewport.add(Ext.create('Syl.view.MyService')); }, }); Okay, now when I run this in the browser, I get this error: "[WARN][Ext.dataview.List#applyStore] The specified Store cannot be found". The app runs but there is no list. I can't understand how this code could work for the people who gave the example and not me. Could it be a difference in the Sencha Touch version? I am using 2.0.1.1. To add to this, I have been having problems in general with lists not displaying. I had originally tried a stripped down list without even having a store. I tried to just set the data property in the list's config. I didn't get this error, but I also didn't get a list to display. That is why I thought I would try someone else's code. I figured if I could at least get a working list up and running, I could manipulate it into doing what I want. Any help would be greatly appreciated. Thanks. [UPDATED] Okay, so I did some more hunting and someone told me I needed to have an instance of my store to load into the list, not the store definition. So I updated the code as you can see and the error went away. The problem is that I still don't get a list. I have no errors at all, but I can't see a list. Am I not loading the data correctly? Or am I not putting the list in the view correctly? [UPDATED X2] Okay, so I learned that the list should be in a container and that I should give it a width and a height. I'm not totally sure on this being correct, but I do now have a list that I can drag up and down. The problem is there is still nothing in it. Anyone have a clue why?

    Read the article

  • touch pad randomly stopped working on ubuntu desktop

    - by Narcolapser
    Question: What steps can I take to make a touchpad that once worked, work again. Info: I'm running ubuntu desktop on my net book. it has been working more or less fine. There have been some minor issues. but nothing to bad. recently I was messing around with burning a mandriva .iso, and suddenly my touch pad just stops working. every now and then it will work for a brief moment after I bring back from sleep mode. The computer says that there is a touch pad and that it is active. any tips?

    Read the article

  • using "touch" to create directories?

    - by user66732
    1) in the "A" directory: find . -type f a.txt 2) in the "B" directory: cat a.txt | while read FILENAMES; do touch "$FILENAMES"; done 3) Result: the 2) "creates the files" [i mean only with the same filename, but with 0 Byte size] ok. But if there are subdirs in the "A" directory, then the 2) can't create the files in the subdir, because there are no directories in it. Question: is there a way, that "touch" can create directories?

    Read the article

  • using "touch" to create directories?

    - by user62367
    1) in the "A" directory: find . -type f a.txt 2) in the "B" directory: cat a.txt | while read FILENAMES; do touch "$FILENAMES"; done 3) Result: the 2) "creates the files" [i mean only with the same filename, but with 0 Byte size] ok. But if there are subdirs in the "A" directory, then the 2) can't create the files in the subdir, because there are no directories in it. Question: is there a way, that "touch" can create directories?

    Read the article

  • How do I configure upstart to run a script on shutdown when the process takes longer than 10secs?

    - by Tiris
    I am running ubuntu 11.10 in a virtual machine (VirtualBox) to learn more about development in linux. I am using a git repository to save my work and have written a script to bundle my work up and save it to the shared folder for use while the virtual machine is not running. I would like to automatically run this script before shutdown so that my work is always available if the vm is off (currently I have to manually run the script). I don't know if upstart is the best way to accomplish this, but this is the config that I wrote as a test: description "test script to run at shutdown" start on runlevel [056] task script touch /media/sf_LinuxEducation/start sleep 15 touch /media/sf_LinuxEducation/start-long end script pre-start script touch /media/sf_LinuxEducation/pre-start sleep 15 touch /media/sf_LinuxEducation/pre-start-long end script post-start script touch /media/sf_LinuxEducation/post-start sleep 15 touch /media/sf_LinuxEducation/post-start-long end script pre-stop script touch /media/sf_LinuxEducation/pre-stop sleep 15 touch /media/sf_LinuxEducation/pre-stop-long end script post-stop script touch /media/sf_LinuxEducation/post-stop sleep 15 touch /media/sf_LinuxEducation/post-stop-long end script The result is that only one touch is accomplished (the first touch in pre-start). What do I need to change to see one of the touches after the sleep to work? Or Is there an easier way to get this accomplished? Thanks in advance.

    Read the article

  • Drawing an arrow cursor on user dragging in XNA/MonoGame

    - by adrin
    I am writing a touch enabled game in MonoGame (XNA-like API) and would like to display a an arrow 'cursor' as user is making a drag gesture from point A to point B. I am not sure on how to correctly approach this problem. It seems that its best to just draw a sprite from A to B and scale it as required. This would however mean it gets stretched as user continues dragging gesture in one direction. Or maybe its better to dynamically render the arrow so it looks better?

    Read the article

  • Multi-Finger Gestures in 14.04

    - by Alex Mundy
    I'm running 14.04 on a Lenovo Y500. I want to get multi-touch gestures running, specifically a three-finger swipe to switch desktops. I would like to keep using the Unity interface, so I can't use touchegg, and I have a buttonless touchpad, so easystroke is not a good candidate either. Is there another third party program that will allow me to use buttonless three finger gestures, or some config hack that will accomplish the same thing?

    Read the article

  • Is there a more efficient way to do this?

    - by garethdn
    I'm hoping there is a better way to the following. I'm creating a jigsaw-type application and this is the current code i'm using: -(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; //location of current touch CGPoint location = [touch locationInView:self.view]; if ([touch view] == img1) { [self animateFirstTouch:img1 withLocation:location]; } else if ([touch view] == img2) { [self animateFirstTouch:img2 withLocation:location]; } else if ([touch view] == img3) { [self animateFirstTouch:img3 withLocation:location]; } else if ([touch view] == img4) { [self animateFirstTouch:img4 withLocation:location]; } else if { ...... ...... } else if ([touch view] == img40) { [self animateFirstTouch:img40 withLocation:location]; return; } } I'm hoping that there is a better, more efficieny way to do this, rather than naming every image. I'm thinking something like, if touch view is equal to a UIImageView, then perform some task. The same for touchesEnded: -(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; //location of current touch CGPoint location = [touch locationInView:self.view]; if ([touch view] == image1) { [self animateReleaseTouch:image1 withLocation:location]; } else if ([touch view] == image2) { [self animateReleaseTouch:image2 withLocation:location]; } else if ([touch view] == image3) { [self animateReleaseTouch:image3 withLocation:location]; } else if ([touch view] == image4) { [self animateReleaseTouch:image4 withLocation:location]; } else if{ ...... ...... } else if ([touch view] == image40) { [self animateReleaseTouch:image40 withLocation:location]; } return; } Any help please?

    Read the article

  • Are there more Cocoa and Cocoa Touch videos which are worth looking at?

    - by dontWatchMyProfile
    To gain a better understanding, I think it would be a good idea to watch every cocoa video available on the net. I tend to find session videos from conferences or good podcast videos only by accident, so maybe someone has a handy list of links to great ressources. I already know all the WWDC stuff and the stuff from stanford, but a lot of universities around the world publish session videos as well in local languages. Also, there are like thousands of conferences around the world with great session videos. This list should compensate for all those who can't afford beeing at WWDC. Therefore, guys, let's create a handy list to fill the gaps for everyone! This is community wiki, so just list them all! I'll start with: English 360 Conferences (360iDev) Videos Oredev with some good iPhone dev session videos German Macoun 2009 with some interesting session videos, if you can speak German Please don't hesitate to post links to videos in other languages than English. Many of us speak more languages, so go ahead! We'll be excited!

    Read the article

  • How to recognize touch events and control a script object inside UIWebView?

    - by Markus S.
    Situation: I have an UIView with an UIWebView in it. When the viewDidLoad the Javascript Object inside the UIWebView is called (Microsoft Seadragon AJAX JS). For your Understanding: Seadragon loads a specified megapixel image(JPEG) and in a Desktop Browser like Firefox i can Zoom into the image and I can drag the crop for example from the middle to the left. In the iPhone Simulator (for iPad) only the Zooming Function is working on one single tap but when i try to drag the crop (with left mouse button click and holding it) I'm dragging the whole UIWebView but not the crop of course! Is that feature which the simulator isn't able to handle or what's yout solutin guys? Special Thanks!! P.S.: It's a bit jiggling when the zooming function of Seadragon is called. Is that authentic to the real performance of the iPad or does the simulator not have the power as the iPad has?

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >