pixel

css browser pixel rounding / overflow hidden with percentages

笑着哭i 提交于 2019-12-24 17:23:30
问题 I am trying to make a scalable grid layout with CSS and I ve came across 2 problems that drive me nuts, so any help is greatly appreciated 1) I have a div with width set to 100% (with overflow hidden) so it covers the full browser window and inside the div I am trying to place ,say 5, divs one next to the other with width 20% but the last one that i want it to be slightly wider (21%). Although i have overflow hidden on the parent container the last div is wrapped below the other four instead

Substituting values of a matrix

冷暖自知 提交于 2019-12-24 10:49:30
问题 Say I have the following two matrices: >> x = [1 4 3; 6 4 3; 6 9 3; 2 4 3; 5 4 0; 5 3 1; 6 4 7]; >> y = [0 0 1; 1 1 0; 1 1 0; 0 1 1; 0.2 0.8 0.54; 1 1 1; 0 0 0]; Where you can think of x as some image, and y the degree of membership of of each element of x to some region of interest. Say I set those elements in x that have degree of membership = 1 to 1 and the other elements to 0 as follows: x = zeros(size(y)); x(y==1) = 1; In which case I will have the following output: 0 0 1 1 1 0 1 1 0 0 1

Pyqt get pixel position and value when mouse click on the image

浪尽此生 提交于 2019-12-24 00:46:21
问题 Overwriting mouse event on pixMapItem didn't work for me ; the mouse click event is not detected by the pixMapItem. Here is my code : import sys from PyQt4.QtCore import * from PyQt4.QtGui import * class DrawImage( QMainWindow ): def __init__(self, path): QMainWindow.__init__(self) self.setWindowTitle('Select Window') self.local_image = QImage(path) self.local_grview = QGraphicsView() self.setCentralWidget( self.local_grview ) self.local_scene = QGraphicsScene() self.image_format = self.local

Is it possible to extract the player's depth pixels only, out of the depth bitmap?

百般思念 提交于 2019-12-24 00:35:46
问题 I am new to kinect developing and new to stackoverflow as well! Here's my situation: Having a depth camera, I can get the depth data easily. What I want to do is once I detect there is a person (player) exists in front of the camera, I would extract the depth pixels of the player only, and put it onto a transparent background, so that the output is a static image of the depth image of the player only, on a transparent background. I would like to ask is it possible to do the job ? I've done

Access to a single pixel in C#

╄→尐↘猪︶ㄣ 提交于 2019-12-23 21:30:20
问题 I'm working on a school project right now. It's meant to be a 3D editing software, (like a very minimized version of Maya). I have to write it in C#, using the 'Windows Application Project'. I intend to implement all the 3D stuff myself, from projections to shading. My question is, how can I get direct access to a single pixel in the C# windows application? I know I'm going to have a main view port in the window. But I haven't decided yet how it will be made. Is there a built in object that I

How can I load a bitmap image and manipulate individual pixels?

青春壹個敷衍的年華 提交于 2019-12-23 09:00:53
问题 I want to load a single large bitmap image from a file, run a function that manipulates individual pixels and then re save the bitmap. File formats can be either PNG or BMP, and the manipulating function is something simple such as: if r=200,g=200,b=200 then +20 on all values, else -100 on all values The trick is being able to load a bitmap and being able to read each pixel line by line Is there standard library machinery in Java that can handle this I/O? (The bitmap will need to be several

How to convert dp to px in xamarin.android?

时间秒杀一切 提交于 2019-12-23 07:27:33
问题 I want to convert dp to px in my C# code in xamarin.android , but all I could find were java codes in android studio that have some problems in xamarin . I tried to use equivalent like using Resources instead of getResources() and I could solve some little problems, but there are some problems yet that I couldn't find any equivalent for them. here are original codes, my codes, and my codes problems in xamarin: First code (found from Programatically set height on LayoutParams as density

How to do pixel-perfect collision detection of a player and the walls (JavaScript Game)

为君一笑 提交于 2019-12-23 06:23:09
问题 I'm making a 2D game in JavaScript. For it, I need to be able to "perfectly" check collision between my players(the game has two players, open the picture please) and the walls! I mean, I have a function that actually works, but when I make them jump against the walls they pass through the walls and keep moving until they reach another area or even leave the canvas! Also, if they are falling down and I make them collide with a wall, they just stop there wich is also pretty bad! I really need

Kinect V2 Depth Frame Pixel Size

◇◆丶佛笑我妖孽 提交于 2019-12-23 05:37:16
问题 The kinect v2 provides a depth frame with the resolution of 512 x 424 pixels with a fov of 70.6 x 60 degrees resulting in an average of about 7 x 7 pixels per degree. [Source]. However I was unable to find any kind of information about the pixel size of the depth frame, or is there any kind of method to calculate the pixel size from the given information? 回答1: Are you asking how you to map size of pixels in the depth data? The depth coordinate system is orthogonal with it's origin and

Is there a way to directly access the color of a pixel of the display in Android?

非 Y 不嫁゛ 提交于 2019-12-23 04:03:58
问题 Do you know if there is a way to get, at some point during the execution of an application, an information of the colors of all the pixels (or one pixel, it's indifferent)? The thing I need to get the average color of the entire display at a particular instant. I only found solutions that use screenshots of the display, but this thing takes time for the computation. Practically, even if there is, I would do something like: Display display = ((WindowManager)getSystemService(this.WINDOW_SERVICE