how to find pixel position of image from sprite image
By : ibn iq
Date : March 29 2020, 07:55 AM
Hope that helps Another, easier way to do this is through this site called Sprite Cow. I just tried it recently, and it makes things go by much faster.
|
Get pixel position of particular point upon resizing the image i.e changing the resolution of image
By : Prasanna Patil
Date : March 29 2020, 07:55 AM
wish help you to fix your issue Hi I have image of 1130*2074 resolution I marked a point at pixel 500,430 I have resized it to 1280*1024 how to get changed pixel position i.e what will be the new position of pixel 500,430 I know that basically pixel size was affected but still.. code :
newX = (500/1130)*1280;
newY = (430/2074)*1024;
newX = (currentX/currentWidth)*newWidth
newY = (currentY/currentHeight)*newHeight
|
HLSL Set pixel position in pixel shader to control where the pixel will end up in the texture
By : Abhijay Khandelwal
Date : March 29 2020, 07:55 AM
it helps some times Basically you can't do what you're describing. After the vertex shader, the GPU has a collection of triangles to draw. It fills them, pixel-by-pixel, on the render target (possibly the backbuffer). As part of this filling process - to determine the colour of each pixel - your pixel shader gets called (like a function) for that specific pixel being filled. There is no capacity at this point for "moving" the output pixel.
|
For each pixel in a image, get the color, pixel position, and coordinates relatively to the image
By : stephanosaurus
Date : March 29 2020, 07:55 AM
I hope this helps you . I suggest you study the BMP file format article over at wikipedia, especially the Pixel storage section. code :
B G R B G R P P B G R B G R P P
B G R B G R B G R B G R B G R B G R B G R B G R
|
Canvas position to image pixel
By : limeash
Date : March 29 2020, 07:55 AM
will help you I want to draw rectangles over an image to markup specific regions. I saw this question: Draw Rectangle over Image and it worked. I get a rectangle over the image. Now i want to get the real pixel position on the image. I know i get some data over Canvas.Left, Canvas.Top but where is the relationship between Canvas and image position? , To make this work you can easily put it in a viewbox like this: code :
<Viewbox> <!-- I will make this construct fit everywhere -->
<Grid> <!-- I will be exactly the size of the image -->
<Image Source="/MyImagegeWithResolutionOf1080x720p.jpg"
Width="{Binding Source.PixelWidth, RelativeSource={RelativeSource Self}}"
Height="{Binding Source.PixelHeight, RelativeSource={RelativeSource Self}}"
Stretch="Fill"/>
<Canvas> <!-- use me to draw your stuff -->
<Rectangle Width="10" Height="10" Canvas.Bottom="360" Canvas.Left="540"/> <!-- I will be in the center -->
</Canvas>
</Grid>
</Viewbox>
|