pixel

int pixels array to bmp in java

How do i create new bmp image in java from int array that contains pixels (from getPixel() of pixelGrabber class) ? Thanks ...

Android + OpenGL ES pixel question

Hello i have been trying to create some simple games lately using the Canvas drawing methods for 2D graphics. Now i want to start programming with OpenGL, i have created the GLSurfaceView but i'm having much trouble understanding the layout and how your moving around the screen with floats. My easiest option would be to make some kind ...

Android - QVGA screen hides some pixels

Hi all, I have a problem with missing pixels on QVGA screen on Android (all versions including 2.2). The original problem was with LinearLayout and margin="1px". It was OK on the normal screen but on QVGA there was sometimes no space between GUI controls, like if margin="0px" and not 1px. So I tried to make the example simple (to be sur...

Can't get a block of div tags to arrange themselves right.

I'm using this block of code (mostly copied from a PHP.net comment here - http://www.php.net/manual/en/function.imagecolorat.php) in order to read in a picture, scan it pixel by pixel and output the picture as a block of div tags in a table-like fashion. Here's what I came up with... <?php $img = imagecreatefrompng("image1.png"); $w...

Attempting to optimize a pixel reading and outputing function.

$img = imagecreatefrompng("img/".$image); $w = imagesx($img); $h = imagesy($img); $pixelcount = 0; echo "<div id='container' style='width: {$w}px; height: {$h}px;'>\r\n"; for($y=0;$y<$h;$y++) { for($x=0;$x<$w;$x++) { $rgb = imagecolorat($img, $x, $y); $r = ($rgb >> 16) & 0x...

Problem reading a cookie from within a tracking pixel in IE

I wrote a simple pixel tracking program that works something like this Step 1) tracker.com sets a cookie Step 2) mysite.com displays <img src="tracker.com/tracking.php">. That image reads the cookie from Step 1 & does some processing. Works great in Chrome, Firefox and Safari. But when tested in IE, the cookie can't be read in Step ...

Quickly getting the color of some pixels on the screen in Python on Windows 7

I need to get the color of some pixels on the screen or from the active window, and I need to do so quickly. I've tried using win32gui and ctypes/windll, but they're much too slow. Each of these programs gets the color of 100 pixels: import win32gui import time time.clock() for y in range(0, 100, 10): for x in range(0, 100, 10): ...

SDL - (Hardware) Pixel Scaling

In my SDL game, I'd like to retain a fixed resolution of the game area, both for gameplay and performance reasons. What I wanted to do was to have a small resolution (e.g. 320 * 240), and when resizing the window / switching to fullscreen mode letting SDL / the graphics card scale each pixel. However the problems that occur are: The ...

fuzzy pixel straddling when drawing in a CATiledLayer on iPhone 4

Hi, I'm drawing a line in a CATiledLayer using the following code: - (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx { CGContextMoveToPoint(ctx, 130, 100.5); CGContextAddLineToPoint(ctx, 160, 100.5); CGContextSetRGBStrokeColor(ctx, 1, 0, 0, 1); CGContextSetRGBFillColor(ctx, 1, 0, 0, 1); CGContextDrawPath...

Problem with shader/code

I have this basic 3d application and trying to write my own toon shader, but even if I remove the tooning part it still still just stays plain darkblue when I give a red color to it. shader code : struct VertexShaderInput { float4 Position : POSITION0; float3 Normal : NORMAL0; float4 Color : COLOR0; }; struct VertexShader...

objective c finding pixel width of a string

I have a UIButton of fixed width and I want to place text in it. Since the size of the String is unknown in advance, I will have to resize the font as I read the String from a flat file. How can I do that? A function similar to the following will be great: UIFont resizeFontAs:(UIFont)initialFont andStringAs:(NSString*)string andWidthA...

OpenGL ES, How to manipulate texture content on the fly

I have an iPad app I am working on and one possible feature that we are contemplating is to allow the user to touch an image and deform it. Basically the image would be like a painting and when the user drags their fingers across the image, the image will deform and the pixels that are touched will be "dragged" along the image. Sorry if...

[GENERAL] Suggestion for graphics library for 2D game (PC)

Hello. I'm trying to set base to a 2D game with destructible terrain and/or particle effects, scroll, zoom, characters, etc... I'd like to know if there is a graphics library that would support those things in both software and hardware acceleration .. (Need pixel access). I've tried SDL (even with directX backend), but it seems hardware...

c# getPixel not sellecting all pixels

Hello! I have a problem with getting the pixels from an image. I load a image, select a pixel from the image and retrieve it's color and then i generate a matrix indexMatrix[bitmap_height][bitmap_width] which contains 1 or 0 depending if the [x,y] color of the bitmap is the same as the color selected. The problem is that the program doe...

Does the Pixel Bender with Flash would use the GPU ?

I write a Pixel Bender kernal for my flash. I know that the pbk would run in another thread. But when I run my swf, the GPU usage shows 0%. I want to know does the Pixel Bender with Flash would use the GPU. ...

What is the average resolution i.e pixel width for a standard web page?

Hi, I just finished constructing web pages and am trying to decide what the optimal lay out should look like. I am trying to decide between a fixed width for my main divs (about 1200 pixles or so) and a variable percentage width. I worry that the variable width will look awful under lower resolutions of under 1600 by 900. I am assuming ...

Div based Page layout - percentage vs fixed pixels

I am new to Div based Page Layouts. My questions is should we design div based page layouts using percentage or fixed pixel? If percentage, what about cross browser compatibility? If fixed pixels, what about different screen resolution? What screen resolution should we opt for? Also, what should be the bases for our decision? ...

What is the best way to have only non-transparent pixel hit testable in images in Silverlight?

According to msdn in Silverlight images are hit testable over their image/media display areas, basically their Height and Width. Transparent / full alpha pixels in the image file are still hit testable. My question is now, what is the best way to have only non-transparent pixel hit testable in images in Silverlight? ...

image pixel values storage in XML using Matlab

Hi ppl. I'm currently working on storing pixels in XML format using Matlab. The problem is that I have no idea about data storage under XML. Can any expert please give me some guidelines? Any relevant materials are welcome and appreciated. Thanks!! ...

Python (creating a negative of this black and white image)

Hi, I am trying to create a negative of this black and white image. The opposite of white (255) is black (0) and vice versa. The opposite of a pixel with a value of 100 is 155. I cannot use convert, invert, point, eval, lambda. Here is my code but it doesnt work yet. Could you please let me know which part i am wrong. def bw_negative(...