XWindows- window with round edge - x11

how to create a window in x-windows with elliptical corners.

The X Shape Extension allows this.

Related

Keep same scale while rotating

I want to keep scale when i rotate verticles. But it is getting smaller after rotation. Picture 3 and 4:
How can i keep it same size ?
Rotate is the wrong tool, if you look directly at the circular face after rotating it will remain circular, where the result you are after will become an oval.
The tool you want is called shear, which will move the top vertices the opposite way to the bottom vertices without altering the height. You can find shear in Mesh->Transform->Shear or the shortcut Ctrl-Alt-Shift-S. The shear tool transforms based on the view so you will want to be in side view when you use it.
Another option would be to use the knife tool to cut a line through your tube.
You can also position a plane over the tube and use intersect (Knife).

DS_ABSALIGN style to avoid calculations

I have a tablet with a stylus, in normal operation it's easy to draw and figure out where the stylus is since hardware feeds the correct coordinates. Then i rotate the monitor 90 ยบ via ChangeDisplaySettingsEx API, in this situation i have to apply a translation (2nd monitor) + rotation which i'd like to avoid. Then i read about this style DS_ABSALIGN in MSDN:
Indicates that the coordinates of the dialog box are screen
coordinates. If this style is not specified, the coordinates are
client coordinates.
I'd like to draw to a DC in screen coordinates which is what i'm being feeded, not client coordinates, but defining that style doesn't make any difference.
//unaffected by the style
DrawIcon(hDevCtx, m_Point.x, m_Point.y, LoadCursor(NULL, IDC_ARROW));
Is it there any way to draw an icon in screen coordinates?
edit: finally i had no choice but to do the calculations for every turn so i close the question
The coordinates you pass to DrawIcon() depend on the kind of DC you have. For example let's say you used GetDC() to get the DC. If you pass it a window handle, the coordinates you pass to DrawIcon() will be relative to the client area of that window. If you pass 0 to GetDC() the coordinates will be relative to desktop screen. If you want to draw on desktop screen then use GetDC(0) or a better method if there is one. If you just want to convert screen coordinates to client coordinates or vice versa use ScreenToClient() or ClientToScreen()

How to get the size in pixels of the Resize Corners of a Window

Is there a way (API) of getting the size (vertical and horizontal) in pixels of the resize corners?
I am referring to the area at each of the corners of a window where you can resize the window in both directions (Left-to-Right and Top-to-Bottom) at the same time using your mouse. You will know you are there with your mouse cursor when you hover over the corners of the window and the mouse cursor is a Diagonal Resizing cursor.
Thank you
Edit:
An example: Hover your mouse over the right edge of a sizable window. Start in the middle (vertically) of the window and move the mouse up along the edge until the horizontal sizing cursor changes to a diagonal sizing cursor. How do I determine by asking the OS how far that position when the cursor changes, is from the top of the window.
I would suggest to use the size of the scrollbars. Call GetSystemMetrics with SM_CYHSCROLL and SM_CXVSCROLL. May be also SM_CYSIZEFRAME and SM_CXSIZEFRAME sizes can be combined.
But I think a better value is to use the height of the status bar. However even Microsoft Windows seems to use some fixed value as can seen on the screenshot.
Comparing the results of GetClientRect and GetWindowRect will tell you how wide the non-client (border) area is along each edge of the window.
If you're concerned that it might not all be active for sizing (true especially along the top), or you want to distinguish the diagonal sizing areas from edge sizing areas, you can take the coordinates discovered in step 1 and pass them to SendMessage(WM_NCHITTEST) See its documentation for the various return codes. There's no problem sending this message repeatedly -- it's designed to be called for each mouse move event and therefore is very fast.

how to draw rect over screen on OS X?

I want draw rectangle over current screen on OS X like rectangle from Grab app when user select area to capture.
Could anybody give me advice about how I can do this?
The way I would do this it to, create your own custom window, you can then give it a transparent background and a border representing your selection rectangle. Do a google search for customer window Cocoa, or irregular shape window cocoa and you will find lots of examples.

SIMPLE Ruby library for drawing shapes and managing clicks

I am looking for simple library for Ruby that could help me drawing things on the screen. I am not developing a game, I just want to display some graphs, so I need to
draw circles on a certain position,
put a label on these circles,
being notified that circle XYZ has been selected (I want to know the circle, not the coords),
draw lines connecting circles' borders,
change the color of the these circles,
(optional) animate moving a circle from position (x1,y1) to (x2,y2) in X seconds,
(even more optional) zoom on part of this scene.
Do you know anything that could help me with this?
Check out the green_shoes gem. Here's an example of some code to get you started, too!

Resources