|
i want to use directx to capture screen then save to file,because i know only a little about managed directx,so the first i Want to create a device link to the desktop,then copy the data from that device,but after i instanced a device,i can't use it,i do not know why, my code like this:
IntPtr hwnd = WinApi.GetDesktopWindow(); //i use api to get hwnd
IntPtr hdc = WinApi.GetDC(hwnd);
Device device = new Device(hdc); //instance here
//then i didn't know how to get the data i use this code
Texture t = Device.GetTexture(0); //can't work here
//or i use this
Surface s = device.GetRenderTarget(0); //also can't work
i really don't know how to do can get the data from the screen then save to file,i hope someone can help me to deal with this question,or you can give me a method to capture the screen,but do not use the gdi+ or graphics.CopyFromScreen method, i only want to use directx to do that. thanks.
|
|
|
|
|
You don't want to use DirectX for that, it's just not needed, and doesn't really help. You're on the right track, you just need to copy from the hdc to a bitmap. The desktop is not drawn using DirectX
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
thanks for your answer, but if i want to save the screen continually like a vedio, i will save 24 bitmaps per second, this will use a lot of CPU and memory, so i'm finding a way to save the screen more quick and less use up. could you tell me how to do that,thanks very much.
|
|
|
|
|
Hi,
In my business logic directory I have a Property class. The namespace for this class is:
namespace MyWebsite.BusinessLogicLayer
{
public class Property
{
}
}
In my website, the I have a backend (admin) control panel where property is added, and the namespace is:
namespace MyWebsite.Web.ControlPanel.Property
{
public partial class InsertProperty : System.Web.UI.Page
{
}
private void InsertNewProperty()
{
// Here I try to insert a new property
}
}
In the InsertNewProperty() I get all the values from the input controls. When I try to create a new instance of the Property class it doesn not find it, instead it gives me an option to chooose only from the Property namespace. My reference to the Property class is like this in the .aspx page:
using MyWebsite.BusinessLogicLayer;
So I do not know what it does this. Can someone please advise me correctly?
Regards
ma se
|
|
|
|
|
hi,
in such conditions, use full name:
eg:
MyWebsite.BusinessLogicLayer.Property p = new MyWebsite.BusinessLogicLayer.Property()
hope this helps.
regards
|
|
|
|
|
you can alias one of these property objects with a using statement. It's something like using MyNamespace.MyObject = MyNewName, but I'm not sure of the precise syntax.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
as Christian mentioned, you could use
using MyNewAliasProperty = MyWebsite.BusinessLogicLayer.Property;
then in code
MyNewAliasProperty p = new MyNewAliasProperty ();
regards
|
|
|
|
|
You can also use an alias for the namespace:
using Bll = MyWebsite.BusinessLogicLayer;
When you want to specify a class in the namespace, use the alias:
Bll.Property prop = new Bll.Propery();
---
single minded; short sighted; long gone;
|
|
|
|
|
"Thou shall not name class and namespace the same."
If you can change name of either class or namespace (Properties perhaps?) by all means do it. If it is late, it is late, and use aliases as suggested above.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Thanks to every one that answered!!!
|
|
|
|
|
I create a dataset from the view.
Dataset is a source for rdlc report.
Later I add new columns in view, delete view in dataset designer and drag changed view from database.
But report displey only data from old columns.
In Data Sources>>Preview Data content from new columns is visible.
Where is mistake?
Thanks for any help.
|
|
|
|
|
HI,
i like to know how to inform an object that something had happend
the story is this :
i have a class named device
and a class named deviceCollection (both are user controls)
in the device class i have a button when pressed i like it to inform the
class named deviceCollection to pass the info to the GUI to be presented
if anybody could help, i'll be happy
my email is amor.kobi@gmail.com
if u like to sent a mail (first TNK u), but write in the TOPIC "#deviceCollection"
and again TNKS
kobkob
|
|
|
|
|
Your subject line says it. Events. Look it up.
only two letters away from being an asset
|
|
|
|
|
|
public delegate void EventInfoHandler(Object sender, EventArgs e);
public EventInfoHandler EventGo;
somewhere else:
myControl.EventGo += new MyControlClass.EventInfoHandler(this.someMethod);
Of course, it's pointless to create delegates and have the standard event signature on them, I mean, do you really want to send an object and a useless event args ?
Like someone else said, looking this up with google would give you tons of examples and info.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello All,
What's the simplest way to add speech command capabilities to a C# application?
I've been looking around on the net but there seem to obe so many different approaches.
Thanks
|
|
|
|
|
Choose an SDK, buy it, and integrate it. I think MS has a free one ? Either way, it's not built in, you need to add it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
hi sirs,
i m praveen a new c# programmer , i have to develop a chat server in c# using Socket not TcpListener , now i don't know how to make my socket which can listen infinite number of clients i can do it with infinite while loop but its not working pls provide me some code , how to do it .
Thanx a lot for all of u .
Pravo
Pravo
|
|
|
|
|
Hello, I think that you are putting your code in the main program, your loop could make up if you make a dll and put in it the code that you need.
I hope that it helps you.
The intelligence without action is nothing.
Mario T.
|
|
|
|
|
Hi Mario ,
Thanx for reply but i need more elaboration of what u said.
And what u mean by "The intelligence without action is nothing".
Pravo
|
|
|
|
|
You need to look into asynchronous sockets. That will allow for infinite or a defined limit of users.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Hi Respected Sirs,
sir i have to develop a unicode symbol dialog like in MS Word , i have done it , i have a panel in my form and again a panel inside first panael i m drawing rectangles in this second panel , i have a combobox for all the languages , now when i click in combobox it shows me all the languages and drwas the characters now when i click on a language in combobox and click on the second panel it doesn't shows me the characters in the area where combobox is i mean the drop area of combobox which is over the second panel . pls help to get rid of this problem.
Pravo
|
|
|
|
|
Hello all,
I am having doubt on Masked Textbox in c# 2.0 version
please tell me how to do...
Many Thanks
~vijay
|
|
|
|
|
What are you having doubts about? Please elaborate a bit more....
"too much daily WTF for someone..." - Anton Afanasyev
|
|
|
|