pixels

Getting pixel RGB from a bufferedImage from the mouses X and Y position

末鹿安然 提交于 2019-11-28 11:51:36
I am making a color chooser program with an image. The program first loads in the image and then when you hover over the image, it will get the current pixels RGB value off of the mouses X and Y position. I have set up the frame and loaded them image, can someone help me get it working with the pixels? package net.ogpc.settings; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.image.BufferedImage; import javax.imageio.ImageIO; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import java.awt

Android TextView setTextSize incorrectly increases text size [duplicate]

安稳与你 提交于 2019-11-28 07:08:46
This question already has an answer here: TextView.setTextSize behaves abnormally - How to set text size of textview dynamically for different screens 7 answers This is in an extension of TextView. getTextSize() and setTextSize() are not overridden, I do not extend those methods. Programming in 1.6, API level 4. The loop in this code causes size to be multiplied by 1.5 every time it iterates, e.g. if size initially reads 200 from getTextSize , then setTextSize(size) is called, getTextSize called again reads back 300. public void shrinkTest() { float size = this.getTextSize(); while (size > 8)

Android OpenGL Screenshot

我们两清 提交于 2019-11-28 07:04:36
I've searched a lot about taking screenshot of my OpenGL object on Android and come up with this solution. It worked great but in my case I have camera view and opengl view(with transparent background) on top of camera view. So what I want to do is to get opengl screenshot with transparent background instead of black. As I said I have tried link above and it worked but I'm stuck with black background. It's little bit complicated to figure out how to get rid of the black background in this particular case. Hope somebody could help me and asap if it's possible(also I think the solution is easy,

How is font size calculated?

橙三吉。 提交于 2019-11-28 06:03:58
I have a complex js function with an equation in which I actually need to understand how much space in pixels font sizes take up. I have noticed that some font's sizes are different depending on the font. How is a font's size calculated? If its set to 12px , in css, what does the 12px mean? Is that 12px wide? High? Or is it a diagonal pixel measurement? SLaks See the spec : The font size corresponds to the em square, a concept used in typography. Note that certain glyphs may bleed outside their em squares. cbednarski Height is the Standard Measure Font height is measured or specified by the

OpenCV pyrMeanShiftFilter in Processing--problems with matrix

混江龙づ霸主 提交于 2019-11-28 05:56:58
问题 I'm trying to use the Mean Shift Function from OpenCV inside a program called Processing, which is a language based on Java. So far, I know that the function requires two mat and two double, [ pyrMeanShiftFiltering( Mat, Mat, Double, Double) ] and the mat needs to be 8 bits and 3 channels. But, when I run it, it only seems to work for the upper 3/4 th of the image and cuts out the rest. Does anyone know how to get this function to run on the whole image? sample image: cat.jpg import gab

Why do I need @1x, @2x and @3x iOS images?

喜夏-厌秋 提交于 2019-11-28 02:56:54
Why do we need these 3 particular image types? If I have a button on my app with a background image say, 50 pixels x 50 pixels, why do I need 3 versions of this image? What's stopping me from just making one image that's much higher in res, say, 700x700 so when it shrinks down on any iPhone it won't fall under the max res the device would want? Only thing I can think of is it just takes up more space, but for simple apps / a simple button it seems like it wouldn't cause any issues. I've tried it on a few devices and see no difference between them when I simulate it and do this method. However,

Difference between Bitmap.Height and VerticalResolution

◇◆丶佛笑我妖孽 提交于 2019-11-28 00:51:12
问题 What is difference in between the b.Height and b.Width properties and the b.HorizontalResolution and b.VerticalResolution in C#? Bitmap b = new Bitmap(@"foo.bmp"); For my sample, Height = 65, Width = 375, HorizontalResolution = VerticalResolution = 150.01239 . MSDN says height and width are in pixels, but the HorizontalResolution and the VerticalResolution are pixel per inch. So, does that mean that is the dpi at which this image was scanned from a scanner for example? Or is this something

How do I load and edit a bitmap file at the pixel level in Swift for iOS?

落爺英雄遲暮 提交于 2019-11-27 20:49:27
I want to manipulate an image at the pixel level in Swift. This question was answered for objective c: How do I access and manipulate JPEG image pixels? , but I would like to see the equivalent source for Swift. Caroline This is how I am getting a color from an image at a touch location. I translated this answer: https://stackoverflow.com/a/12579413/359578 (This sample does no error checking for nil) func createARGBBitmapContext(inImage: CGImage) -> CGContext { var bitmapByteCount = 0 var bitmapBytesPerRow = 0 //Get image width, height let pixelsWide = CGImageGetWidth(inImage) let pixelsHigh =

Getting pixel RGB from a bufferedImage from the mouses X and Y position

久未见 提交于 2019-11-27 19:21:53
问题 I am making a color chooser program with an image. The program first loads in the image and then when you hover over the image, it will get the current pixels RGB value off of the mouses X and Y position. I have set up the frame and loaded them image, can someone help me get it working with the pixels? package net.ogpc.settings; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.image.BufferedImage; import javax.imageio.ImageIO; import javax.swing.ImageIcon

C++ Pixels In Console Window

烂漫一生 提交于 2019-11-27 19:10:15
In C++ using Code::Blocks v10.05, how do I draw a single pixel on the console screen? Is this easy at all, or would it be easier to just draw a rectangle? How do I color it? I'm sorry, but I just can't get any code from SOF, HF, or even cplusplus.com to work. This is for a Super Mario World figure on the screen. The game I think is 16-bit, and is for the SNES system. C::B says I need SDK for C::B. It says "afxwin.h" doesn't exist. Download maybe? This is what I'm trying to make: It depends on your OS. I suppose you are programming in a Windows platform, therefore you can use SetPixel but you