How to draw rotated text with ScriptTextOut? - c

How do I draw rotated text using the ScriptTextOut function?
I tried both Graphics::SetTransform and SetWorldTransform and they didn't seem to do the trick.

Related

using mouse click to detect contour in opencv

I have various contours/segments in an image. Right now I use the keyboard to input which segment I want to extract from the image (given below)
Consider the pink area as segment 1 and white area as segment 2. I use keyboard to input which segment(1 or 2) I want extracted.On drawing contour I get
I have saved the colours of each segments in an array and I use the array to extract the particular segment.
Now I want know if its possible to use mouse click to identify the segment/contour, So that I can draw multiple contours and identify the segment using mouse and not use keyboard to input the segment number.
I know this question was asked a while ago, but this is what I did to solve my problem. I was doing it in python, but it should be similar.
I used the OpenCV floodfill algorithm to fill where I clicked, using the drawn contours on a binary image as the floodfill mask, where the contours are white and background is black. This way the floodfill cannot pass the contour edges.
Once you fill the contour with a certain color, it's easy to extract it using some sort of thresholding.
Hope this helps.

How to map CALayer texture to cube so text in layer show up correctly?

I am adding a CALayer to a SCNBox geometry contents... It works and I see this:
I want to be able to see the text on the box correctly. I understand that the texture is now applied to the geometry etc...
How can make it so the text I write in the CALayer shows up horizontally around the box...?
the default UVs (or texture coordinates) of an SCNBox are such that the same content is displayed on each side. You will have to rebuild a geometry with new texture coordinates so that the pattern does not repeat. You can start from scratch, or build an SCNBox and retrieve its geometrySources.

C# How to draw a Polygon connected by smooth curved lines

Hi friends i'm developing an application just like ms paint, in that i want to draw a polygon like shape with curved lines.I used graphicsPath and drawcurve method but i'm not able to get the corners.Please give me some idea for drawing
Plolygon with curved line.

Possible to give fixed angle in path?

I have a path as shown in the attached image. i would like to know if it is possible to give a fixed angle for the edge of the path, coz i would like to use the same angle while styling other controls as well. Is there a way to make this possible (in Expression Blend)?
You can do this using 'Subtract' Path Operation.
1) First draw the required shapes like
2) Draw a small rectangle and rotate it to a certain angle you want. Say 50. Then, place the small rotated rectangle over the shapes draw previously, like
3) Bring each of the Big Shapes to the front, like
4) Finally, goto "Object -> Combine -> Subtract" by selecting each big and small rectangle pair. The final output will have same angle, like

Draw circle around a white area in OpenCV (C language)

how can I draw a circle around a white space in a image file with OpenCV (C language)?
image example:
thanks a lot!
First you can use FindContours to find all (in your case 1) contours (blobs/regions) in the image, then you can draw a circle or any other shape you want around the contour.
Edit: To draw a circle you can use Circle.
you can compute moments first, then get circle info from it.
You don't really need opencv for that, you just loop over your image and calculate the bounding box surrounding the white blob, get the center and the radius of your circle is the length from the center to any corner. Then just use GDI or something to draw your circle.

Resources