coordinates

Size and position of one image in another via PHP

女生的网名这么多〃 提交于 2019-12-03 21:16:24
I have two images(small and big). Big one contains a small one. Like if the small one is a photo and a big one is a page from the photo album. How do I get coordinates of that small image in the big one using PHP? And also I need to know the size of that image in big one...so just a(x,y) coordinate of any angle and sizes of sides of that presentation of the small image... (x,y, width, height) I've already asked the question like that and got a brilliant answer ( here ) but I've forgot to mention over there that the size of a small image could be different from the the size of that image in the

Comparing Touch Coordinates

南楼画角 提交于 2019-12-03 20:57:00
Is it possible to compare touch coordinates made by the users on the UIView to the one store in a plist or txt format? The argument looks like this; if (user touch coordinate == touch coordinate stored in plist or text) then (do something) else (do something) If possible in what format should i write the coordinates in the list and how to associate it inside the program? thanks in advance and sorry if you find my question a bit noobie. Not sure if there's a one-liner solution. On a UITouch instance, the locationInView: method returns a CGPoint struct (x and y coordinates, both of type float).

google maps, cellid to location

柔情痞子 提交于 2019-12-03 18:20:33
问题 According to this sample: http://www.codeproject.com/KB/mobile/DeepCast.aspx It's possible to request a gps coordinate (longitude & latitude) including range when sending cellid information (MCC, MNC, towerid, etc) Can someone tell me the actual parameter to request/post to this address? http://www.google.com/glm/mmap It could be something like this http://www.google.com/glm/mmap?mcc=xxx&mnc=xxx&towerid=xxx And i would like to know what response we would get. I have observe OpenCellid website

Sorting according to clockwise point coordinates

断了今生、忘了曾经 提交于 2019-12-03 18:04:09
问题 Given a list in Python containing 8 x, y coordinate values (all positive) of 4 points as [x1, x2, x3, x4, y1, y2, y3, y4] ( (xi, yi) are x and y coordinates of ith point ), How can I sort it such that new list [a1, a2, a3, a4, b1, b2, b3, b4] is such that coordinates (ai, bi) of 1 2 3 4 are clockwise in order with 1 closest to origin of xy plane, i.e. something like 2--------3 | | | | | | 1--------4 Points will roughly form a parallelogram. Currently, I am thinking of finding point with least

Distance between two coordinates, how can I simplify this and/or use a different technique?

北城余情 提交于 2019-12-03 18:00:23
问题 I need to write a query which allows me to find all locations within a range (Miles) from a provided location. The table is like this: id | name | lat | lng So I have been doing research and found: this my sql presentation I have tested it on a table with around 100 rows and will have plenty more! - Must be scalable. I tried something more simple like this first: //just some test data this would be required by user input set @orig_lat=55.857807; set @orig_lng=-4.242511; set @dist=10; SELECT *

GLSL: gl_FragCoord issues

穿精又带淫゛_ 提交于 2019-12-03 17:46:02
问题 I am experimenting with GLSL for OpenGL ES 2.0. I have a quad and a texture I am rendering. I can successfully do it this way: //VERTEX SHADER attribute highp vec4 vertex; attribute mediump vec2 coord0; uniform mediump mat4 worldViewProjection; varying mediump vec2 tc0; void main() { // Transforming The Vertex gl_Position = worldViewProjection * vertex; // Passing The Texture Coordinate Of Texture Unit 0 To The Fragment Shader tc0 = vec2(coord0); } //FRAGMENT SHADER varying mediump vec2 tc0;

Python win32com and 2-dimensional arrays

荒凉一梦 提交于 2019-12-03 17:29:43
When using python and win32com to automate the software form Adobe one encounters problem with passing arrays of 2d coordinates. If one looks at code that Adobe ships for visual basic (VB) its simple. A simplified example for drawing a line in Illustrator would look as follows: Set appObj = CreateObject("Illustrator.Application") Set docObj = appObj.Documents.Add Set pathItem = docObj.PathItems.Add pathItem.SetEntirePath Array(Array(0.0, 0.0), Array(20.0, 20.0)) Now the naive assumption is that VB code could just just be turned into python by converting it as follows: from win32com.client

In Objective-C (OS X), is the “global display” coordinate space used by Quartz Display Services the same as Cocoa's “screen” coordinate space?

走远了吗. 提交于 2019-12-03 17:07:12
问题 I'm attempting to create an image "loupe" for my application that can be used to inspect images at different magnification levels, and I have run into a bit of a road bump. I'm using Quartz to create a CGImageRef snapshot of a selected portion of the display my app's window is on. The problem is, the nomenclature used by all of the different OS X technologies has me really confused. The function I'm using is CGDisplayCreateImageForRect(CGDirectDisplayID display, CGRect rect) . The

Unprojecting 2D Screen Coordinates to 3D Coordinates

六眼飞鱼酱① 提交于 2019-12-03 16:17:34
I was wondering how I would go about mapping 2D screen coordinates to a 3D world (specifically the xz plane) knowing: -position of the camera -equation of the screen plane -equation of the xz plane All I want to do is have the land on the xz plane light up when I hover the mouse over it. Any help is greatly appreciated! Thanks! If your world is rotated and shifted such that the camera is at x=y=z=0 (world coordinates), the world z coordinate increases away from the viewer (into the screen), and the projection plane is parallel to the screen and is at z=d (world coordinate; d > 0 ), then you

Determining location of tray icon

ε祈祈猫儿з 提交于 2019-12-03 13:30:53
My application is designed to sit in the system tray and behave similarly to the Network/Volume/Power/Action Centre tray items in Windows 7 (and the equivalent items in Windows Vista). That is, it becomes visible when the tray icon is clicked, and becomes hidden when focus is lost. The application is written in WPF, but I am currently using NotifyIcon from WinForms for the tray icon. I would like to know if anyone has any suggestions as to how I might determine the position (i.e. screen coordinates) of my application's tray icon. The default Windows Vista/7 tray items have some way of doing