AxWindowsMediaPlayer video 180 rotation or vertical flip (C#) - c#

Is it possible to roatate (or flip) screen of AxWindowsMediaPlayer? I have found only one solution - to make screenshots with genereting Bitmap, RotateFlip() it and copy to PictureBox. By it requires one more showing Form (or graphical space anyway) for not rotated AxWindowsMediaPlayer. If you have any idea how to get Bitmap, for example, from hidden AxWindowsMediaPlayer directly or directly rotate AxWindowsMediaPlayer screen or you know different good player please help
many thanks

Related

Detect UNITY UI image only moves inside another image or rect transform

I have two image in my unity scene.
One of this images is an square as background Recttransform and another image is a button.
I use Drag Event for this button to detect movement in run time.
But I want to move this button only inside the background image.
And I don't know how to make this limitation.
Is there any solution for this issue ?
For more explanation please see this image :
Off the top of my head, here are a two ways to do this:
Create a few invisible box colliders and place them at the edge of the red square. Probably easiest but more prone to issues when screen size changes.
Get Screen.width, Screen.height, Rect.width, and Rect.height. Only allow drag up to the edges of the screen minus 1/2 Rect.width and 1/2 Rect.height.

Is there a way in Unity3D to detect that a gameobject is on top of a pillarbox in order to avoid rendering it

I am currently developing a 2D Unity game.. At the moment I was able to implement a code that allows the camera to keep the aspect ratio which is initially 16:9 and when the aspect ratio is different it will add the letterbox perfectly. My issue is that I have a HUD that can be hidden by the player, so when I have letterbox implemented the HUD is not hiding properly.. I've spent heaps of time trying to find an answer but I haven't been able to.. Is there a way to avoid rendering/showing the part of the HUD that is on top of the letterbox.? I am attaching an image that shows how the HUD looks normally and how it is being displayed when hidden.. Any help will be greatly appreciated.. Thanks in advance.!
Normal HUD:
Hidden HUD:
You can use a RectMask2D component to mask out the letterbox area. You want to attach the RectMask2D to an object that is a parent of your inventory box. Children of the RectMask2D will only appear within the area of their parent, so if the mask does not cover the letterbox area, then your inventory bar will not appear over the letterbox either.

Animating an image not playing in game scene

I am trying to make an animation of a countdown.
I first made a Gameobject, created a canvas for it, and inside that canvas I created a UI Image, attached an image to it, and finally created an animation with that image.
Everything is working fine except the animation is not showing in game scene but only in normal scene, but when I go to that UI Image component and start the game I can see the image changing which means that its not the animation but something else.
Does anyone have an idea of what's going on?
There are several possibilities. Depending on if the image is showing up at all, you can check if your UI image is anchored correctly (four triangle marks) or pivot position is where you want it (circle mark). Depending on how this is done, if you Game window resizes in play-mode with the display set to Free Aspect, your image may move off the visible screen or, in some cases, get crushed which usually shows up as a red X in the editor. I can see this happening if your Game window is set to Maximize on Play.

VR score text display

I am trying to make a VR game with google cardboard in unity. However we can not find a way to display score text right in front of the player. However when I add 2D text it is only on one side and therefore on one side of the eye and getting the position right for 2 texts is hard. If I use 3D text and set in front of the players position I think it will go into the wall if a player hits one. Is their any way to display a score on google cardboard / Unity VR.
You can either use native Unity Canvas UI or Googles hack to render OnGUI calls onto a texture.
I would definately recommend Canvas as that is the way Unity is working on their UI features, and it has much better layout capability.
To use canvas, Right click in the hierarchy and add UI->Text. You will automatically get a canvas. The important part is set the canvas to world-space (not screen space overlay). Then drag the canvas game object so it is a child of the Google Cardboard Main head object. Scale it down (like x:0.001,y:0.001,z=0.001) because by default it will be massive. To avoid going through walls position it about 0.5m in front of the camera - within any collider you may have.
there is another approach as well which you can place that canvas under camera make it world space, and then adjust it as you want, after that where ever you look at it will be seen easily ( as suggested by earlier user in answers) as you can see below in picture i placed canvas > Text > under camera which i used for oculus/ google camera

WinForms Draw parts of image at a rotated rectangle frame

I'm working on image transitions for my digital photo frame and am trying to achieve this transition:
It's more of a radar-style transition with the wiping effect going from one side to another in a 180 degree angle. Although, it doesn't appear that "blocky", I just spaced out the rectangles for illustration purposes. The entire thing should be a smooth transitions without any FPS stuttering effects.
My logic is to draw the specific part of the image at (theta) rotation angle like my drawing above - but that will end up drawing 100's of rectangles that sweeps across the screen.
Is there a more efficient way to do this? If not, could I have a few code tips to point me in the right direction?
It is practically impossible to have without any FPS shuttering especially in bigger screens because WinForms uses CPU only rendering. You will have to embed OpenTK (if you want to use OpenGL) or Direct3D frame inside, or maybe WPF where you do the animation.
If you use any of them (for example OpenGL), you have to load it as a texture, and the animation would be done on the triangle level (dragging the corners only) not on the image itself.
If you want to have a curved surface, like a real page transition, I recommend to use a bezier patch as is found here: http://nehe.gamedev.net/tutorial/bezier_patches__fullscreen_fix/18003/
This coding takes a lot of time, and is much more over the purpose of StackOverflow (to setup a full OpenGL/DirectX control + how to do a Bezier patch if you want to set it up).
If you don't want to embed anything, you may look to this transformations tutorial using WPF, but I'm not 100% sure that this is what you need:
http://www.codeproject.com/Articles/14895/WPF-Tutorial-Part-Transformations

Categories