|
Enable anti-aliasing for line drawing.
|
|
|
|
|
i had already tried changing SmoothingModes and CompositingQuality but nothing changes, the problem is there r missing things in the region of my control!
|
|
|
|
|
What do you mean "missing things"? Be a little more technical please. If you're missing certain UI elements like a handle or something, then you need to create a more advanced region.
Another option is to use an image format that supports an alpha channel (like PNG) for your button and then P/Invoke SetLayeredWindowAttributes and use the LWA_ALPHA (0x02) to mask the alpha channel. This will still result in a rectanglular control, but the transparent portions of the image will be transparent. Another problem is, though, that this is only supported on Win2K and higher.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Looking at your original code, you set the region as the size of the graphicspath, but your code does not show whether you in fact draw the graphics path onto the graphics object. Are you doing it?
|
|
|
|
|
How do you create a callback for an OnViseme event in c#?
I've got a simple TTS that I want to animate facial features with
But can't get any viseme events.
public void SpeakText(string text)
{
// Create a Text To Speech voice and speak the specified text.
try
{
//SpFlags = SpeechVoiceSpeakFlags.SVSFDefault ;
SpFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync;
Voice = new SpVoice();
if(selectedVoice != null)
{
Voice.Voice = selectedVoice;
}
Voice.Rate = rate;
//Voice.add_Viseme(new _ISpeechVoiceEvents_VisemeEventHandler(vismeHandler ));
Voice.Viseme +=new _ISpeechVoiceEvents_VisemeEventHandler( vismeHandler );
Voice.Speak(text, SpFlags);
}
catch
{
MessageBox.Show("Speak error", "SpeechUI", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
|
|
|
|
|
Hi,
I need to add soem custome HTML text in the New Message window of OutlookExpress.
I used the ObjectFromLresult and the IHTMLDocument for getting the HTML of that part whose class is Internet_Explorer Server.I wrote a function which will take the handle of the windows & returns IHTMLDocument.It is as follows
Public Function IEDOMFromhWnd(ByVal hWnd As Integer) As IHTMLDocument
Dim IID_IHTMLDocument As System.Guid = New System.Guid("626FC520-A41E-11CF-731-00A0C9082637")
Dim lRes As Int32
Dim lMsg As Int32
Dim hr As Int32
Const SMTO_ABORTIFHUNG As Int32 = &H2
If Not hWnd.Equals(0) Then
If Not hWnd.Equals(0) Then
' Register the message
lMsg = RegisterWindowMessage("WM_HTML_GETOBJECT")
' Get the object
Call SendMessageTimeout(hWnd, lMsg, 0, 0, SMTO_ABORTIFHUNG, 1000, lRes)
If lRes Then
' Get the object from lRes
hr = ObjectFromLresult(lRes, IID_IHTMLDocument, 0, IEDOMFromhWnd)
If hr Then Throw New COMException(hr)
End If
End If
End If
End Function
But the problem is that I'm not getting the HTML Body even I used the Script property of IHTMLDocument. In the interface variable its showing <undefined value="">. Then in the Script property call Error triggers as Object not reference to an instance of an object.
Please Help me
Its Urgent
Manjith
|
|
|
|
|
I am just wondering if I'm headed in the right direction for this.
Could I use the Bitmap.Clone() to specify the area to grab out of an existing image?
i.e.
Point point = new Point(0 , 0);
Size size = new Size( 100, 50 );
Rectangle rect = new Rectangle( point, size );
Bitmap bitmap = new Bitmap.Clone( rect, System.Drawing.Imaging.PixelFormat.DontCare );
Will this get me the portion of the image that starts at 0,0 and has a width of 100 and a height of 50?
Any feedback will be greatly appreciated.
No comment, Mr. Senator<pre>
|
|
|
|
|
Well, that's what the documentation says. In most cases, I'd trust the documentation.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I'd go with Heath on this. As a little tip, if there is anything in the documentation that I don't quite understand I build myself a little demonstrator application (5 minutes work) to test my interpretation of the documentation. That way I can see if it works the way I think it does or not, and if not I now have a test platform to work from to see exactly how it is working.
I hope this helps.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
Coming soon: The Second EuroCPian Event
|
|
|
|
|
I am trying to run the crystal reports custom tool on some VS/C# project reports and i am getting the error Load crpe32.dll failed. I tried registering it and got some error saying the entry point could not be found.
I know others have had this problem from some searching around but yet to find a fix for it.
My crpe32.dll is in Program Files\Common Files\Crystal Decisions\1.0\Bin
|
|
|
|
|
The has to do with the PATH environment variable, which Windows/Windows NT uses to find executables. If that directory is not in the PATH environment variable, then just specifying it like [DllImport("crpe32.dll")] will not work since it can't be found. Also, you should not hard-code this path in the DllImportAttribute because it may not be the same on every machine. Instead, in your installer add that directory to the PATH environment.
One other way is to use Environment.GetFolderPath with the Environment.SpecialFolder.CommonProgramFiles enum member to get the path to "\Program Files\Common Files" and use Path.Combine to append "Crystal Decisions\1.0\Bin", which should be the same in all cases (the "Common Files" directory is the last configurable directory for Windows in this case). You could then P/Invoke LoadLibrary , GetProcAddress , and FreeLibrary to load the proc address and execute it like a delegate (create a delegate with a matching signature).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath Stewart wrote:
Instead, in your installer add that directory to the PATH environment.
I really hate that! Especially when company X add a PATH to its internal cygwin dir, and you just dont understand why cygwin just wont run the updated programs. (because it added itself to the start of the PATH and not the end, because for some strange reason PATH is limited to 255 characters, all others are 32k long AFAIK). OK enough monday blues Me go sleep now
|
|
|
|
|
Are you talking about executing only one copy of the game at a time or only once per user login? The 'once per session' is what's throwing me...
RageInTheMachine9532
|
|
|
|
|
Ok, look into Mutex's. A C# example and a class you could use can be found here[^] on CodeProject.
RageInTheMachine9532
|
|
|
|
|
Hello,
Anyone here who have worked with this component? I'm having some problems. When I add a new document and editor control to the document, I want the new document to be the active document with focus on the editor. I can't get this to work.
Thanks in advance!
~~~~~~~~~~~~~~
Martin Lundberg
Student, Sweden
I have to thank every member of the Code Project for making it such a great place for a beginner to learn!
|
|
|
|
|
Martin Lundberg wrote:
When I add a new document and editor control to the document, I want the new document to be the active document with focus on the editor. I can't get this to work.
TabIndex is most likely the thing to set...
|
|
|
|
|
Hello, Yes i thought so but I can't figure out how to get it to work =/
~~~~~~~~~~~~~~
Martin Lundberg
Student, Sweden
I have to thank every member of the Code Project for making it such a great place for a beginner to learn!
|
|
|
|
|
I'd like to be able to run the stored procedure sp_helpfile from within my C# program against my MSDE db. Is this possible?
I haven't a clue on how to set up a structure to hold the results of the command.
Any help would be appreciated.
cb
|
|
|
|
|
|
I ran the demo and got "An exception 'System.Data.SqlClient.SqlException' has occured in SPTestApp.exe".
cb
|
|
|
|
|
You do it just like I told you to do for the sp_attach_db stored procedure. Look at the SQL docs for the names of the parameters and use this in the SqlCommand.Parameters.Add method as I did with the other stored proc.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for all of your help.
I just didn't know how I 'captured' the return values.
There is only one parameter to pass, the db.
cb
|
|
|
|
|
Handle the SqlConnection.InfoMessage event. With each message printed by the server this event is raised. You can get the message from the SqlInfoMessageEventArgs that is passed to your handler.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi, all!
I have struggled too many hours now to find out how to connect to a
remote web service using w2k .Net soap over ssl.
I have received a certificate file from the publisher, xxx.pem which I divided in two, one xxx.crt (certificate) and one xxx.key (rsa private key).
Both base64-encoded. I have also received a passphrase for the private key.
But I just can't figure out how to put all this together, and successfully
manage to make a request from my C#-app.
How, for example, to include the private key with passphrase in the request???
I would be sooo happy for some answers...
Regards
Christer
|
|
|
|
|
This... is a long road with many a winding turn... took me quite some time to get everything working correctly.
You fail to specify whether your C#-app is an ASP.NET web service client or a console/winforms web service client. I'll presume it's the latter as that's remarkably easier.
At either length it's easiest to use Microsoft WSE 1.0 enhancements[^] to fetch the certificate from the certificate store.
By default it is presumed that your client certificate is in the personal store of the current user (e.g. the one that is executing the application). If this is ASP.NET then as the user doesn't have a login profile the user doesn't have a personal store folder either and you need to carefully import the certificate to the personal store of the local machine.
The following code will get the private certificate from the depths of the certificate store:
<br />
byte[] certhash = { 50, 49, 239, 183, 249, 60, 36, 134, 129, 159, 39, <br />
226, 197, 70, 76, 1, 147, 237, 43, 217 };<br />
<br />
X509CertificateStore store = X509CertificateStore.CurrentUserStore(X509CertificateStore.MyStore);<br />
store.Open();<br />
X509CertificateCollection certs = store.FindCertificateByHash(certhash);<br />
store.Close();<br />
X509Certificate cert = certs[0];<br />
There are other ways to find a certificate than by using its hash value, but you can refer to the WSE 1.0 documentation for these.
Now, to add the certificate to the service call let's presume your web service object is Service1 then you add it fairly simply using:
<br />
Service1.ClientCertificates.Add(cert);<br />
It doesn't seem so daunting when you look at it like this, but it can take a lot of time to figure out given the.... usefulness.... of most code examples around. I think that's all it takes, good luck fighting the certificate mmc snap-in.
Hope this helps.
--
Henrik Stuart (http://www.unprompted.com/hstuart/[^])
|
|
|
|