pixel

iPhone 4 mobile web app pixel scaling issues

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm having trouble getting my mobile web app to render properly on my iPhone 4. According to Wikipedia, the iPhone 4 has 960 width x 680 height pixels and the other iPhones have something like 480 width x 340 pixels. With my current build, the images and CSS styling look really tiny on the iPhone 4. Here is my code: <!DOCTYPE html> <html> <head> <title> mobile </title> <link rel = "stylesheet" type = "text/css" href = "iphone.css" media = "only screen and (max-width: 480px)" /> <link rel = 'stylesheet' href = 'highRes.css' media =

How to create an image pixel by pixel

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to create an UIImage pixel by pixel in swift 3 I have searched but couldn't find the code that actually works So let me explain, I have an array with characters var array = ["w", "x", "y", "x", "y", "y", "y", "x", "x", "x", "w", "x", "y", "w", "y"] //there will be like 26 millions of those if it's w, the color of the pixel will be blue if it's x, the color of the pixel will be red if it's y, the color of the pixel will be green if it's v, the color of the pixel will be black I want to create an image from those characters and store it

How can I pixelate a jpg with java?

泪湿孤枕 提交于 2019-12-03 07:52:43
问题 I'm trying to pixelate a JPEG with Java 6 and not having much luck. It needs to be with Java - not an image manipulation program like Photoshop, and it needs to come out looking old school - like this: Can anybody help me? 回答1: Using the java.awt.image (javadoc) and javax.imageio (javadoc) APIs, you can easily loop through the image's pixels and perform the pixelation yourself. Example code follows. You will need at least these imports: javax.imageio.ImageIO , java.awt.image.BufferedImage ,

Is it wise to use fractional / decimal pixels for borders in css?

拥有回忆 提交于 2019-12-03 07:49:36
I have various instances in my design that call for border-right: 1.5px solid black; border-bottom: 1.5px solid black; etc... I also have design that needs thinner lines: at 1px . However, it seems the browser may round the decimal, as I'm not seeing much differentiation between the two (if any). Should I just be using 2px and 1px instead, or is there a better way to pull this off? A designer I'm helping is very adamant about the 1.5px line width. Any help, much appreciated. You can use it, but most browsers will round pixel value. http://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html

IplImage Pixel Access JavaCV

怎甘沉沦 提交于 2019-12-03 07:42:42
I'm trying to access Pixel by Pixel of an IplImage. Im using Java and Processing, and sometimes I need to access pixel by pixel. I've done this so far, but I don't know what's wrong: public IplImage PImageToIplImage(PImage imageSrc) { IplImage imageDst; if(imageSrc.format==RGB) { imageDst = IplImage.create(imageSrc.width, imageSrc.height, IPL_DEPTH_8U, 3); ByteBuffer imagePixels=imageDst.getByteBuffer(); int locPImage, locIplImage, x, y; for(y=0; y<imageSrc.height; y++) for(x=0; x<imageSrc.width; x++) { locPImage = x + y * width; locIplImage=y*imageDst.widthStep()+3*x; imagePixels.put

Painting pixels images in Java

耗尽温柔 提交于 2019-12-03 07:25:55
Which method is the best way to create a pixel image with java. Say, I want to create a pixel image with the dimensions 200x200 which are 40.000 pixels in total. How can I create a pixel from a random color and render it at a given position on a JFrame. I tried to create a own component which just creates pixel but it seems that this is not very performant if I create such a pixel a 250.000 times with a for-loop and add each instance to a JPanels layout. class Pixel extends JComponent { @Override protected void paintComponent(Graphics g) { super.paintComponent(g); g.setColor(getRandomColor());

What could cause the same browser on different PCs to render the same HTML differently?

放肆的年华 提交于 2019-12-03 07:24:28
I'm stumped. A client and I are both running Firefox 3.0.12 on XP machines. We view the same page in the same browser on different machines and have different results. Note: All IE browsers are consistent on both of machines, and my FF 3.5.1 is consistent with my FF 3.0.12. (He does not have FF 3.5.x installed to compare with). There is a 1 pixel difference that causes his header div (all images, no text) to wrap. Mine is fine. If I expand his header by 1 px (via Firebug css editing), it works. So my question is what other variables are there that affect rendering?? I'm trying to think

python — measuring pixel brightness

喜夏-厌秋 提交于 2019-12-03 05:58:57
问题 How can I get a measure for a pixels brightness for a specific pixel in an image? I'm looking for an absolute scale for comparing different pixels' brightness. Thanks 回答1: To get the pixel's RGB value you can use PIL: from PIL import Image from math import sqrt imag = Image.open("yourimage.yourextension") #Convert the image te RGB if it is a .gif for example imag = imag.convert ('RGB') #coordinates of the pixel X,Y = 0,0 #Get RGB pixelRGB = imag.getpixel((X,Y)) R,G,B = pixelRGB Then,

How to calculate the average color of a UIImage?

霸气de小男生 提交于 2019-12-03 05:11:52
问题 I want to build an app that lets the user select an image and it outputs the "average color". For example, this image: The average color would be a greenish/yellowish color. At the moment, I got this code: // In a UIColor extension public static func fromImage(image: UIImage) -> UIColor { var totalR: CGFloat = 0 var totalG: CGFloat = 0 var totalB: CGFloat = 0 var count: CGFloat = 0 for x in 0..<Int(image.size.width) { for y in 0..<Int(image.size.height) { count += 1 var rF: CGFloat = 0, gF:

android fast pixel access and manipulation

馋奶兔 提交于 2019-12-03 03:45:16
I'm trying to port an emulator that i have written in java to android. Things have been going nicely, I was able to port most of my codes with minor changes however due to how emulation works, I need to render image at pixel level. As for desktop java I use int[] pixelsA = ((DataBufferInt) src.getRaster().getDataBuffer()).getData(); which allow me to get the reference to the pixel buffer and update it on the fly(minimize object creations) Currently this is what my emulator for android does for every frame @Override public void onDraw(Canvas canvas) { buffer = Bitmap.createBitmap(pixelsA, 256,