sharpdx

Mediafoundation cant decode video on certain NVIDIA cards

时光总嘲笑我的痴心妄想 提交于 2021-02-20 04:36:26
问题 We are using the SharpDX .NET wrapper to make Mediafoundation decode an MP4 Video into a DirectX9 texture. This works fine, except that it crashes on certain NVIDIA cards for example the 940MX . For example the same machine with an Intel HD graphics card decodes the video stream fine. Unfortunately we cant get any other details than a E_FAIL/Unspecified error from SharpDX . Even with the debug layer enabled. Any ideas how to find out why it crashes? VideoMediaType outputVideoFormat;

How to get a SourceReader to decompress frames and send them to a Direct3D9 texture?

时光总嘲笑我的痴心妄想 提交于 2021-02-18 18:56:39
问题 I am trying to get a MediaFoundation SourceReader to read an H.264 video file, and render the frames to some Direct3D textures so I can them render them as I wish with Direct3D. I'm using SharpDX, but the principles are of course the same as native code. As I understand it, the general data flow should be like this: A SourceReader reads and decodes the video using SourceReader.ReadSample() A VideoProcessor (from IDirect3DDeviceManager9 ) transfers the frame to a Direct3D9 surface using

Drawing visual behind a window using directx

孤者浪人 提交于 2021-02-11 17:17:09
问题 Is there any way to draw the content behind a window using directx. For example: the magnifier used by windows. I was trying to achieve the acrylic blur effect of windows 10. What I need to do is to capture the portion behind the window and blur it using direct 2D Gaussian Blur effect. So is there any way to get the backdrop (visual behind the window) using direct x? Note: i tried using magnifier api of windows and it is flickering the screen while resizing or moving the window Here is a

Drawing visual behind a window using directx

淺唱寂寞╮ 提交于 2021-02-11 17:12:12
问题 Is there any way to draw the content behind a window using directx. For example: the magnifier used by windows. I was trying to achieve the acrylic blur effect of windows 10. What I need to do is to capture the portion behind the window and blur it using direct 2D Gaussian Blur effect. So is there any way to get the backdrop (visual behind the window) using direct x? Note: i tried using magnifier api of windows and it is flickering the screen while resizing or moving the window Here is a

XAudio2 - Play generated sine, when changing frequency clicking sound

三世轮回 提交于 2021-02-08 04:57:28
问题 I want to develop an app to match your tinnitus frequency : A frequency is played and the user decrease or increase the freqency by pressing a plus or minus button. (see part of the codes, based on some coding from stackoverflow thx :-)) public static short[] BufferSamples = new short[44100 * 1 * 2]; private SourceVoice sourceVoice; private AudioBuffer buffer; private int Tfreq; public MatchTinn() { InitializeComponent(); Loaded += MatchTinn_Loaded; TFreq = 5000; } private void MatchTinn

DirectX C# SolidBrush is drawing white

风格不统一 提交于 2021-01-29 07:29:07
问题 I want to draw on a window. To do that I created several brushes. For testing I used a normal red (255, 0, 0). Now I want to use more specific color like a 198, 17, 17 red. I am creating the brush like this: SolidColorBrush _redBrush = new SolidColorBrush(_device, new RawColor4(198, 17, 17, 1)); When I now draw in the window it is not red instead it is just white. Could anyone please tell me what is wrong with this and how I can draw with the color I actually want? Sorry if this is a really

How to capture frames from a webcam with SharpDX

拟墨画扇 提交于 2020-06-17 13:25:27
问题 I'm trying to implement a webcam capture app which should take still frames, display them on the screen and save to the disk. Since I'm using SharpDX already to capture the screen, I thought it would be nice to use that library. I was not sure if SharpDX had any video capture capabilities, so I started searching and found parts of what it looks like a webcam capture prototype: var attributes = new MediaAttributes(1); attributes.Set<Guid>(CaptureDeviceAttributeKeys.SourceType,

Right justify text using SharpDX/Direct2D

夙愿已清 提交于 2020-06-01 07:17:58
问题 I have some code to draw some text: var textFormat = new SharpDX.DirectWrite.TextFormat(fontFactory, "Arial", SharpDX.DirectWrite.FontWeight.Bold, SharpDX.DirectWrite.FontStyle.Normal, SharpDX.DirectWrite.FontStretch.Condensed, 16.0f); renderTarget.DrawText("AC", textFormat, textRect, textBrush, DrawTextOptions.NoSnap); The text is drawn starting at the top-left of the target rectangle. Is there any way to right-justify the text? 回答1: The fourth entry for the google search "right justify text

How to use xbox one controller in C# application

∥☆過路亽.° 提交于 2020-01-23 03:00:27
问题 There already exists a large amount of information for using an xbox 360 controller in C#, but I didn't find as much info for an xbox one controller. I need very basic operation out of it, specifically the joystick and trigger values. The majority of information online is for C++ applications, but rather than attempting to write a custom library, I'd like to use something like SharpDX. How do I use this in my application? Note: I'm posting this to share info that I found, as well as