Screen / window coordinate of a point in OxyPlot - oxyplot

I am using OxyPlot to draw a smooth curve using some input points. I now want to paint the background of the plot depending on the curve. e.g. The rectangle where the curve is below a certain y-value should be painted red, and if it above another specific y-value, the background should be painted green.
For this, I would need some way to get the screen coordinate for any point on the OxyPlot curve? Is this possible?

Related

UV/Texture pixels crossed by Seam edge are not painted as expected

Unwrapped object was filled out with gradient color. As illustrated in below image, some pixels in UV/Texture view on Seamed edges boundaries are not filled with expected color. It looks like edge has to cross more than a half of the pixel to be colorized.
Is there a way to force all pixels crossed by Seam edge to be colorized properly?
Found a solution. Navigate to Texture Paint for given object and open Options, modify Bleed property, which defines how many pixels will be colorized in UV texture outside Seamed edges. Default is 2px.

Rotating an image in Photoshop causes transparent pixels on image border, how to stop this?

I start with a seamless grass texture h133 w133 px, I then rotate it by 45 degrees and divide the height by 2 so i'm left with an isometric diamond shape. The background is #FF00FF that i key out when rendering my tiles.
As you can see, the diamond edges are transparent like after this process see the pic:
closeup pic of the transparent diamond edge
How to stop the transparent pixels and make them solid, thanks.
It sounds like Photoshop is automatically changing the edges when you do any transformation on any object.
Try going to Menu > Edit > Preferences > General
and select 'Image Interpolation' and under that choose "Nearest Neighbor (Preserve Hard Edges)". This will make sure that the pixels stay sharp like those 8-bit artworks.

Drawing dots in polar

how to draw just dot in polar coordinates, cannot find any example like that?
When I choose theta and some radius nothing gets displayed, other graphs works perfect.

How to recognize the touch of a non regular sprite image?

I have a sprite and if it is touched the touch should be recognized. I used the coordinates to do so. I took the coordinates (min x, min y, max x , max y)of the sprite image. But The sprite image is not a rectangular shape. So, even if I touch the coordinates outside the sprite and inside the rectangular bounds the sprite is recognized.
But for my application I need only the sprite to be recognized. So, I have to take only the coordinates of the sprite, but it is not regular shape. I am using CCSprite in my program.
So, what can I do to for only the sprite to be selected ? Which classes should use for this?
Thank You.
You could try one of the following...
Create a bounding box smaller than the absolute extents of the sprite image. Yes it will be smaller than the sprite. This will eliminate the dead space click detection of the sprite the trade off being parts of your sprite which look selectable won't be
Use a circular bounding area to detect if the user has clicked on your sprite. Again you will have the dead space problem in my first suggestion but the sphere may give you some better coverage area over the sprite giving you better results on touch detection
This is a standard problem in physics collision detection systems which often end up using circles or rectangles as their collision bodies. I would go with the either a circle or rectangle smaller than the size of your sprite as your bounding area. Going finer detail than that you could generate bounding area polygons. This would however introduce a whole bunch of new issues and concerns.
I am building a Cocos2D game right now and what I am doing is first I step through my sprites and see which sprites the touch hit (they overlap in my app)
Then, for each sprite hit I use [sprite convertTouchToNodeSpace] to get an X,Y co-ordinate inside the sprite, which I can use (although the Y axis is flipped) to reference the CGImage I created the sprite with.
If the pixel at the touch point is 'clear' ie alpha 0, then the sprite was not really touched, and I check the next sprite in the z-order to see if it has color where it was touched.
Sometimes I think I should be using a two color mask image to go along with each sprite, not the sprite image. But, I am mr. make it work, then make it fast.
I realise this is not super efficient, but I do not have very many sprites and I do this only for touches.

How To Draw More Precise Lines using Core Graphics and CALayer

Hello I am having a hard time making this UI element look the way I want (see screenshot). Notice the image on the right--how the line width and darkness looks inconsistent compared to the image on the left (which happens to be a screen grab from safari) where the border width is more consistent. How does apple make their lines so perfect?
I'm using a CALayer and the Core Graphics API to draw the image on the right. Is it possible to draw such perfect lines with the standard apis?
The problem with drawing a 1-pixel path is that Quartz draws paths on an exact point grid, starting from {0,0}. This means that if you stroke a vertical path starting at {10,10} with a 1-point width, half of that line will render in the pixel to the left of the coordinate and half in the pixel to the right, causing a blurring effect.
You should therefore shift your drawing by {0.5,0.5} if you want lines to draw on exact pixels.
You can definitely draw what you want with Quartz.
Apple uses images for the tab elements.