pixels

Resizing an image in cm C#

I have an requirement that asks for an image with 10 X 6,88 cm. I know that I can't simple convert from cm to pixels, cause one pixel size depends on the user display resolution. I would like to know if there is a way to resize an image to have that size in cm. (I need to keep the image extension also. e.g.: can't convert it to a pdf or ...

Change pixels to fill with color in a WPF image

Hello, I'm trying to fill an area of an image in WPF. Something similar to the bucket in Paint. How should I do this? I'm thinking of getting the pixel color under the mouse, and change all the pixels with the same color near. Is there a simpler way? What should I use? WriteableBitmap? Thank you ...

how to efficiently track the use of space on a map, both objects and free areas.

OK I start with a blank map, which is 512x512 = 262144 pixels/locations. I need a way to efficiently draw some objects on it, and then be able to find the areas of free space, so that later more different objects can be added to these free areas. I cant figure out the best way to store this data, or algorithms to find the free areas. I...

Drawing pixels based on mouse position

Scenario: I have an area on the browser screen n x n in size (500px x 500px for example, ie 250,000 pixels). As the mouse rolls over the area, it "paints" the pixels it passes. Percentage of filled/unfilled pixels are displayed Optional advanced scenario: As the mouse rolls over already painted pixels will "unpaint" those pixels, or pa...

Position of Div in relation to the Top of the Viewport

Hi Everyone: I am wondering how I can get the amount of pixels (or measurement in general) from a div to the top of the window in Javascript. I am not looking for an offset y in relation to the document, simply to the top of where the browser is displaying. I tried the "answered" solution here: http://stackoverflow.com/questions/21170...

CSS width/height pixel and percentage calculation combintaion?

Is there a way to set the height/width CSS properties to something like that: 100% - 50px So if the total 100% is 1000px, then the end result would be 950px. And the 100% is set by the browser size. Thank you. UPDATE: What I'm trying to do is: I have two div, the first div's height is 50px, I would like the second div's height to cove...

How Bicubic-interpolation work?

After reading text about this said topic, i found out that it considers 16 of the original neighboring pixels. What i want to know is how does it compute the color value of the new pixel. If the color of pixels can be determined by 200,100,255, how could you compute the value of the new one? ...

Select area on camera view on iphone

Hello! I am really new to iphone programming and I am trying to build an application that uses camera live view to select a rectangle by touch events. I want to store the pixels in that rectangle in a pointer. Can anyone help me out with this code? Thank you! ...

How can I find out a web page viewers pixels per inch?

Can anyone think of a way I can discover a users pixels per inch? I want to ensure that a image displays in a web browser exactly the size I need it to, so using a combination of resolution (which I can get from the user agent) and pixels per inch I could do this. However, I'm not sure if there is any way to discover a users pixels per...

how do i calculate the centroid of the brightest spot in a line of pixels?

i'd like to be able to calculate the 'mean brightest point' in a line of pixels. It's for a primitive 3D scanner. for testing i simply stepped through the pixels and if the current pixel is brighter than the one before, the brightest point of that line will be set to the current pixel. This of course gives very jittery results throughou...

Can I make a rather native C++ app with Android?

I'm interested in the following features: Writing an app for Android Market that is written completely in C++ (a port of existing product actually). Use fast screen-buffer pixel pushing (or rather using OpenGL ES for this). Grab user input and direct it to C++ code. Is it legal to write such an app for Market? Is Market policy someho...

Matlab Bwareaopen equivalent function in OpenCV

hi! Im trying to find similar or equivalent funtion of Matlabs "Bwareaopen" function in OpenCV? In MatLab Bwareaopen(image,P) removes from a binary image all connected components (objects) that have fewer than P pixels. In my 1 channel image i want to simply remove small regions that are not part of bigger ones? Is there any trivial w...

What are the units for form widths and heights in VBA?

I'm programming VBA for Word 2007. I've created a UserForm which I need to resize with script. I noticed that its not pixels Me.Width = pixelW // form appears about 20% larger than the pixel width And its not twips either Me.Width = (((1 / TwipsPerPixelX()) * pixelW)) / 1) // form appears very small So how are form widths an...

How can I stretch bitmap in WPF without smoothing pixels

Hi, I'm working on SEM image processing application, written in WPF. I have an image display control, derived from Canvas, which displays image & overlays using DrawingVisuals (one for each "layer"). It also implements Zoom & Pan using scale & translate transform, applied on DrawingVisuals. When I zoom in the image to see individual pi...

CSS: Setting width/height as Percentage minus pixels

Hi all, I've seen this question asked in a couple other contexts on SO, but I thought it would be worth asking again for my particular case. I'm trying to create some re-usable CSS classes for more consistency and less clutter on my site, and I'm stuck on trying to standardize one thing I use frequently. I have a container div that I d...

Skewing an image using Perspective Transforms

I'm trying to perform a skew on an image, like one shown here . I have an array of pixels representing my image and am unsure of what to do with them. ...

opengl invert framebuffer pixels

I was wondering was the best way to invert the color pixels in the frame buffer is. I know it's possible to do with glReadPixels() and glDrawPixels() but the performance hit of those calls is pretty big. Basically, what I'm trying to do is have an inverted color cross-hair which is always visible no matter what's behind it. For instance...

c++ read image pixels

I want a c++ Code to read every pixel from an image file. and i want to save the pixels like: r[] g[] b[] does somebody know how to do this? ...

Is it bad to work with pixels in CSS?

Is it bad in terms of compatibility to use pixel numbers in CSS instead of percentages? How about lower resolutions? Is it okay to work with them in ranges of 1-100? ...

Efficient pixel shader sum of all pixels

How can I efficiently calculate the sum of all pixels in an image, by using a HSLS pixel shader? I'm interested in Pixel Shader 2.0, that I could invoke as a WPF shader effect. ...