sharpdx

Pass color name as string in SharpDX.Color

浪尽此生 提交于 2019-12-11 19:12:46
问题 i am getting a color name as string (like "Black"). have to convert that color name as SharpDX.Color for my Metro app. now trying in following ways, 1)SharpDX.Color.FromRgba(int or uint value of color) 2)SharpDX.Color.FromArgb(int or uint value of color) is it possible to do this in this way.? or any other best way to done this.?? 回答1: Using Enum Parse and System.Drawing can help, it's not great but that would work: KnownColor colorenum = (KnownColor)Enum.Parse(typeof(KnownColor),"Black");

SharpDX Not Drawing

一世执手 提交于 2019-12-11 19:06:56
问题 I am trying my hand at writing a simple DirectX 11 application in C# using SharpDX. I am able to set the clear color, and that works, but when I try to draw polygons, they do not show up. I am creating a new Game class in another source file to create the window and draw to it. Game.cs: using System; using System.Linq; using System.Drawing; using SharpDX.Windows; using SharpDX.DXGI; using SharpDX.Direct3D; using SharpDX.D3DCompiler; using SharpDX; using DXMath = SharpDX.Mathematics.Interop;

Resizing Texture before sending to SinkWriter SharpDX

心已入冬 提交于 2019-12-11 17:32:06
问题 I'm working on Screen recording application. My problem is I need to resize the Texure2d before making sample using CreateDXGISurfaceBuffer. I'm new with Mediafoundation and upon reading the documentation I couldn't find any sample code from the website. I'm using IDXGIOutput1::DuplicateOutput to get the screen texture. Is there a better way to resize the texture without suffering the performance? 回答1: Video Processor MFT can scale your textures. When you use it in Direct3D 11 enabled mode,

Does SharpDX have an enum giving constant names to the Direct2D error codes that can be returned in a SharpDXException?

北战南征 提交于 2019-12-11 16:07:43
问题 class SharpDXException has a field int HResult that is set to a non-zero error code when an error is reported by the underlying Microsoft DirectX code. For example, when using SharpDX.Direct2D1 , Microsoft docs list these Direct2D error codes. For example, D2DERR_RECREATE_TARGET 0x8899000C Searching SharpDX sources, I don't see anything with "RECREATE" in it. I am hoping that there is some error enum that is auto-generated, and therefore not in the sources. So could type something like

SharpDX.SharpDXException when starting audio source - c#

☆樱花仙子☆ 提交于 2019-12-11 16:06:16
问题 When I'm trying to record audio using accord.net, it throws an exception Accord.Audio.DirectSound.pdb not loaded $exception {"HRESULT: [0x88780064], Module: [Unknown], ApiCode: [Unknown/Unknown], Message: Unknown"} SharpDX.SharpDXException I'm using Windows 10 Pro 64 bit with Visual Studio 2017. Accord.Audio - v3.8.0 Accord.Audio.DirectSound - v3.8.0 SharpDX -v2.6.3 SharpDX.DirectSound - v2.6.3 My code is here using Accord.DirectSound; using Accord.Audio; namespace TestAudio { public partial

How to apply shader to an Bitmap offline with SharpDX

有些话、适合烂在心里 提交于 2019-12-11 11:43:37
问题 i want to apply a shader to a bitmap (offline processing) with sharpdx. I found a sample on SharpDX homepage to apply an effect to an image with offline processing. Now i want to apply a shader.fx to it but i don't know how to do it. Can anyone help me out? Here are the code snipset: // Effect 1 : BitmapSource - take decoded image data and get a BitmapSource from it var bitmapSourceEffect = new d2.Effects.BitmapSource(d2dContext); bitmapSourceEffect.WicBitmapSource = formatConverter; //

Reading Datastream sharpDX Error all values are 0

白昼怎懂夜的黑 提交于 2019-12-11 07:59:16
问题 I followed this solution for my project : How to create bitmap from Surface (SharpDX) I don't have enough reputation to comment so I'm opening a new question here. My project is basically in Direct 2D, I have a Surface buffer, a swapchain. I want to put my buffer into a datastream and reads it's value to put it into a bitmap and save it on disk ( like a screen capture), but my code won't work since all the bytes values are 0 (which is black) and this doesn't make sense since my image is fully

How to apply a SharpDX.Toolkit.Graphics.Effect directly?

孤者浪人 提交于 2019-12-11 07:54:32
问题 I'm creating an image editor for Windows Phone 8 / Windows 8 using SharpDX api and trying to apply a custom effect (SharpDX.Toolkit.Graphics.Effect) to a WriteableBitmap. The effect itself is applied, but the result looks strange. Seems to me that the texture was reduced and inverted. The code to apply the effect is written below. private void ApplyEffect() { GraphicsDevice graphicsDevice = GraphicsDevice.New(); RenderTarget2D renderTarget = RenderTarget2D.New( graphicsDevice, _originalBitmap

SharpDX load a texture in Windows Phone 8

天涯浪子 提交于 2019-12-11 07:42:55
问题 I'm creating a Windows Phone 8 app and I'm using SharpDX to load a texture. I've tried to load PNG using Content.Load<Texture2D>("filename.png") but I've got errors and I've realized that SharpDX in Windows Phone 8 only accepts DDS textures and doesn't accept PNG/JPEG/BMP etc. I've converted my PNG to DDS using texconv filename.png and added the file to my solution just like other files that I'm using in my project (that I can load correctly). When I run my app, I'm getting an exception:

Embed button control into existing Direct3D application

天大地大妈咪最大 提交于 2019-12-10 22:04:25
问题 I would like to overlay own content above a Direct3D v9 game (made by a third party). Overlay Interactive Button Specifically, I would like to overlay a clickable button control, like Steam does, for instance, though I'm attempting a much simpler interface. Ideally, I would be able to overlay a WPF button or a Windows Form button or whole UserControl, but if that is not possible then creating a functioning button from primitives would suffice as well. Text Overlay Working with SharpDX I have