pixel

Converting between physical pixels and CSS pixels

匿名 (未验证) 提交于 2019-12-03 02:00:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Mozilla's documentation from elementFromPoint explains that the coordinates are not in physical pixels, but "CSS pixels". Exactly what are CSS pixels? I was under the impression that a pixel in CSS was the same as the physical pixel. If this is not the case, how does one convert between physical and CSS pixels? 回答1: A pixel is a physical screen pixel as far as any web page can reasonably concern itself. The wording ‘CSS pixel’ refers to a pixel as defined in CSS 2 the whole number of device pixels that best approximates the reference pixel.

BufferedImage getRGB vs Raster getSample

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to do some image processing in Java. I used ImageIO library for reading and writing images. I can read the image pixel value in two ways as follows (there might be other methods). Using BufferedImage's getRGB method: pixel = image.getRGB(x,y); Using Raster's getSample method: WritableRaster raster = image.getRaster(); pixel = raster.getSample(x,y,0); What is the difference in above two approach? 回答1: 1: The first approach will always return a pixel in int ARGB format, and in the sRGB color space. Regardless of the image's

What does -webkit-min-device-pixel-ratio: 2 stand for?

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: @media only screen and (max-device-width:480px), only screen and (-webkit-min-device-pixel-ratio: 2) { /*iphone css*/ } max-device width makes sense but pixel ratio doesn't make any sense to me. thanks. 回答1: From http://developer.android.com/reference/android/webkit/WebView.html The -webkit-device-pixel-ratio CSS media query. Use this to specify the screen densities for which this style sheet is to be used. The corresponding value should be either "0.75", "1", or "1.5", to indicate that the styles are for devices with low density, medium

coordinates out of bound:bufferedimage

匿名 (未验证) 提交于 2019-12-03 01:39:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I made a program to separate red blue and green components of a image but the code below gives an error: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds! at sun.awt.image.ByteInterleavedRaster.getDataElements(ByteInterleavedRaster.java:318) at java.awt.image.BufferedImage.getRGB(BufferedImage.java:888) at rgb.Rgb.main(Rgb.java:46): Here is the source code: public static void main(String[] args) { String type = "jpg"; BufferedImage img = null; try { img = ImageIO.read(new File("d:\\a.jpg"));

Pixel formats, CVPixelBufferRefs and glReadPixels

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using glReadPixels to read data into a CVPixelBufferRef . I use the CVPixelBufferRef as the input into an AVAssetWriter . Unfortunately the pixel formats seem to be mismatched. I think glReadPixels is returning pixel data in RGBA format while AVAssetWriter wants pixel data in ARGB format. What's the best way to convert RGBA to ARGB ? Here's what I've tried so far: bit manipulation along the lines of argb = (rgba >> 8) | (rgba using a CGImageRef as an intermediate step The bit manipulation didn't work because CVPixelBufferRef doesn't seem

How to create and implement a pixel tracking code

感情迁移 提交于 2019-12-03 01:32:34
问题 OK, here's a goal I've been looking for a while. As it's known, most advertising and analytics companies use a so called "pixel" code in order to track websites views, transactions, conversion etc. I do have a general idea on how it works, the problem is how to implement it. The tracking codes consist from few parts. The tracking code itself. This is the code that the users inserts on his webpage in the <head> section. The main goal of this code is to set some customer specific variables and

Calculating pixel size on an iPhone

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there a way in the iPhone SDK to calculate the size (in millimeters) of a single pixel? 回答1: Well, the size of a pixel is a constant. The screen size of a current iPhone or iPod touch 2" x 3" (50.8 mm x 76.2 mm) and the resolution is 320 x 480 pixel. 50.8 / 320 (or 76.2 / 480) => the size of 1 pixel is 0.15875 mm x 0.15875 mm 回答2: Answering the question as asked about the size of pixels: Pixel size on an iPhone and iPod Touch The earlier iPhones (pre-iPhone 4) Apple iPhone Technical Specifications said : 480-by-320-pixel resolution at 163

How can I get and set pixel values of an EmguCV Mat image?

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm using the EmguCV 3.0.0 wrapper to the OpenCV 3.0 library. I'm using the Mat class in a few places. Here's an example of a single channel, 8x8 image made of double values: Mat image = new Mat ( 8 , 8 , DepthType . Cv64F , 1 ); The Image<> class provides reasonable means for getting and setting pixel values , and the method is identical for the Matrix<> class, but it doesn't seem as obvious for the Mat class. The only way I've figured out how to set individual pixel is using a mask: // set two pixel values, (0,0) to 9.0, (2, 3)

DPI Graphics Screen Resolution Pixels WinForm PrintPageEventArgs

匿名 (未验证) 提交于 2019-12-03 01:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: How do Dpi Points relate to Pixels for any display my application is running on? int points ; Screen primary ; public Form1 () { InitializeComponent (); points = - 1 ; primary = null ; } void OnPaint ( object sender , PaintEventArgs e ) { if ( points < 0 ) { points = ( int )( e . Graphics . DpiX / 72.0F ); // There are 72 points per inch } if ( primary == null ) { primary = Screen . PrimaryScreen ; Console . WriteLine ( primary . WorkingArea . Height ); Console . WriteLine ( primary . WorkingArea . Width ); Console . WriteLine (

Convert Image Color without changing its transparent background

匿名 (未验证) 提交于 2019-12-03 01:14:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Does anybody have a good solution to change the color of a non-transparent area, with the help of HTML5 or Canvas (or any other HTML5 technology). I googled a lot and found some solution (with Canvas) which can change the color of an image,like, How do i tint an image with HTML5 Canvas? Canvas - Change colors of an image using HTML5/CSS/JS? But these solution also change the transparent background to the given color ( which i don't want ). Its a stackoverflow png image with transparent background. Now, i want to change image color without