I want to create a Windows service in C# that can create a snapshot and send it to the server.
but my problem is when using "Screen.PrimaryScreen.Bounds". Visual Studio cannot speak.
I've searched a lot about this but can't seem to get any results.
thank you for helping me.
That is a display problem. Might or might not be a data problem.
You are attempting to 'display' the data that you go via some mechanism so that your eyes can see it. That means that the computer must attempt to take the data and map it to a character set. That involves at least one and perhaps more than one transformation. Any of those can fail in different ways.
The surest way to show data is to learn what hex is and then create (or find) code that displays your data in hex. Every character set I have ever looked at will show hex data. (I think even EBCDIC but I could be mistaken and you are really unlikely to have to deal with that.)
Pass-by-value is when someone presents an answer to your problem.
Pass-by-reference is when someone tells you "Why don't you just f***g google it?"
For being slightly more helpful:
Pass-by-value is when the caller makes a copy of the argument and hands this copy over to you. It carries no information about where your copy of the value is taken from - it may very well be the value of an expression directly stated in the argument list of the actual call. The copy is yours, and whatever you do to it won't affect anyone else. The value (copy) exists only as long as your method is running.
Pass-by-reference is when the caller doesn't give you a copy of the value, but rather tells you where you can find it, i.e. the location (address) in memory where the value is stored. You have to go and look there to find the value. In most cases, other parts of the program will be looking in the same location, and if your method changes the value stored, others who subsequently look there, will see your modifications to the value. The location exists both before and after the call to your method.
There is nothing C++ specific to this; it goes for all languages (or rather: all languages providing both call-by-value and call-by-reference - which are most of them).
Victor gave "value" AND a "reference". Should he read it out loud or copy and paste it?
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
hello every body.
I wanna to create windows service with c # that ,it able tack snapshot and send to server.
but my problem iswhenusing"Screen.PrimaryScreen.Bounds" .visual studio cant know this.
I was so much search bout this problem but I cant get result.
thank you for help me.
Services can't access the screen, keyboard, mouse, or any other element of the user interface at all. They can't start an app that can access the UI either!
Why not? Becauses services are designed to run when there is no user, and hence no user interface.
I don't know what you are trying to achieve, but you will not get this to work at all.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
Basically, a hamburger button's flyout contains a Splitview, where the pane is a Listview menu. When a menu item is chosen, the SplitView's content frame navigates to an associated page. Simple enough.
On a menu page, if I have a button with a flyout that contains a ColorPicker, there seems to be some sort of dismiss area overlap problem. I've tried various combination of LightDismissOverlayMode settings on the SplitView and the button flyouts, to no avail.
Here's the hamburgar button within the StackPanel of the main page:
That's a good theory, and it led me to the solution.
If you refer back to the picture linked in the OP, the problem smells of two transparencies overlapping each other, but even when removing all transparent colors from my code, the problem persisted.
So, for a final test I went into my Windows Settings/Personalization/Colors and noticed "Transparency Effects" was enabled. Disabling it solved the problem, and I guess it makes sense since my app inherits its theme from the Windows settings on my PC. Nevertheless, this seems like an odd behavior from the base Windows theme for it to show up only when related to flyouts.
I'm guessing there's a way to override the base theme on a child flyout, but for now I'm just going to leave Transparency Effects disabled.
this is bullshit, the first VAO without std::vector get drawn but not the second with vector :
Vertices = Vector3f(-1.0f, -1.0f, 0.5773f);
Vertices = Vector3f(0.0f, -1.0f, -1.15475f);
Vertices = Vector3f(1.0f, -1.0f, 0.5773f);
Vertices = Vector3f(0.0f, 1.0f, 0.0f);
Your vector contains pointers to vertex, not the actual vertices. In fact it contains the same pointer four times, so even if OpenGL can handle pointers to vertex data you only have the same vertex repeated. The index buffer suffers from the same problem.
The third parameter is supposed to be a pointer to the data you wish to copy, but you are passing a pointer to a pointer. The vector contains a list of pointers to vertex elements, so &Vertices2 is the address of the first pointer item in the vector. It should be:
So I'm aware of MonoGame, SharpDx, etc, but these are all significant overkill for what I need, and what's more, none of them work over the remote desktop protocol.
I'm just wanting to do some very simple 2D graphics, and it doesn't even have to run at a particularly high frame rate (even 20FPS is fine). But most importantly, it has to work over the RDP, which means it has to be software rendering.
I have played with a WritableBitmap with some degree of success, but was wondering if anyone had any other ideas?
Obviously, this isn't for any sort of "real" game or anything. Just basically an exercise to keep me from forgetting how to use C#.
I'm somewhat new to DirectX programming and need a bit of guidance. My requirement is currently limited to video and 2D drawing and so far I've managed to get SharpDX to play a video from a file without problems, and also have been able to do my 2D drawing. This was simple enough and the performance is good.
Ultimately, my video source will need to be video input devices ( i.e. web cams, video capture cards, etc. ).
My question is: Does SharpDX.MediaFoundation include DirectShow wrappers such that I can access and play video from local video input devices? If so, can someone point me in the right direction and link some examples of using SharpDX for this purpose?
I understand it's no longer supported, but it's battle tested and I don't think the risk at present is any greater than investing in the "latest and greatest" GUI framework only to have it killed off before it gets off the ground.
Besides, I feel if I use SharpDX to get a better handle on the underlying concepts, porting to something new(er) when required would be easier.
As to my original question, I know there's other NuGet packages that make easy work of displaying camera input ( i.e. AForge, Accord ), but I'm not convinced they're taking full advantage of the GPU, which is what I'm looking for. Specifically, I need to route the capture byte stream directly to the mediaengine's render surface as I'll be dealing with larger sizes and framerates.
I'm using WinForms (yeah, I know ... old school), tho I don't think that makes much difference as in the end its simply the window/control Handle that has to be specified as the swapchain.OuputHandle. I'm doing that already for playing a video file as a test and performance is very good.
When looking through SharpDX.MediaFoundation with Reflector, I get the strong feeling it provides the means for capture input, but I can't find any complete examples in that specific area.
No problem. Given that it saw over 2.5 million downloads, I figured there might be somebody that used it for this purpose and I don't think DirectX11 is going anywhere any time soon.
As for newer platforms, I unfortunately don't have a lot of experience with them so I'm concerned about the stumbling block that would present and not knowing their limitations. I could struggle my way thru UWP, but using what accelerated graphics API? Win2D? WinUI3? DirectN ?
It's hard to know which platform to choose that will still be around by the time I learn it.