|
That's exactly the sort of situation that the Word 2003 XML Schema[^] solves. Your users upload Word 2003 documents saved as XML (and you can automate this using solution files) and you work with pure and rich XML. Send the modified (or original) version back with the right content-type and it works just like an actual document in every way.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
i'm making a 2d sprite game with directx but i can't figure out how to use the alpha channel so that parts of my images are transparent. what is the best type of image to use, .png, .bmp? and how do i apply an alpha channel to them.
thanks,
Rob Tomson
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|
|
.bmp does not support alpha channels, nor does .jpg, .gif, or .tiff. .gif only supports an indexed color to serve as a transparency, which is the same as what is done for 24-bit and lower .ico files. .png does support alpha channels. You can find lots of information about image formats by searching the web, but this forum is not the appropriate place for questions not related to using C#. You can also use Image.IsAlphaPixelFormat on each member of the PixelFormat enumeration to see which ones that GDI+ (which .NET uses for the graphics classes) supports support alpha channels.
If you're question is about how to use such images in C# then see the Image class in the .NET Framework SDK. Managed DirectX can also make use of these, as well as native code. Use Bitmap.GetHbitmap to get an IntPtr that represents the HBITMAP (native handle to a bitmap data structure, which describes about any image format) for calls to native APIs that require an HBITMAP .
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi,
I am trying to build a general purpose math and graphics class library, but am running into problems because it seems that you can't use graphics classes in a class library unless the library is control-based. But I don't want a control, just some classes and methods for mathematical and graphical calculations. Does anyone out there know how to do this?
Thanks,
Royce
|
|
|
|
|
|
Of course u can, but the class library template does not reference the System.Drawing assembly. U'll have to add that reference manually.
|
|
|
|
|
first let me explain my situation, my room mate and i both have computers and often enough there's something one of us wants to show the other on our screen but we're to lazy to get up and go look. so this is what i would like to do: i would like to grab a window, like internet explorer, and drag it to his desktop so that he can now see the page. or just send the current screen display to his computer.
thanks,
Rob Tomson
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|
|
|
You want to program this yourself?!?
Use VNC. Messing around with it in a private network is really funny.
|
|
|
|
|
How to get that any Arrow key is pressed.
|
|
|
|
|
Override the KeyPress, KeyDown, or KeyUp event (as you need) in your form class, and check the KeyValue values of KeyEventArgs.
Peter Molnar
|
|
|
|
|
I m sorry are you asking me to use in Key down event
<br />
if(e.KeyValue == Keys.Down)
i have tried every mathod that i know to get ArrowKeys but not able to do so. Please help me.
|
|
|
|
|
Ok Problem Solved. For others Info how i able to do this
<code
protected override="" bool="" processcmdkey(ref="" message="" msg,="" keys="" keydata)
="" {
="" switch(keydata)
="" case="" keys.down:="" label1.text="Hello" ;
="" break;="" and="" for="" other=""
="" }
="" return="" base.processcmdkey="" (ref="" keydata);
="" }
}
<="" code="">
havn't find any other mathod so if you know any other mathod i really would like to read. Thanks in advance
|
|
|
|
|
you should cast the Keys enum to int, so it will compile
private void OnKeyPress(object sender, System.Windows.Forms.KeyEventArgs e)
{
if(e.KeyValue == (int)Keys.Down)
{
...
}
}
Peter Molnar
|
|
|
|
|
Hey all,
I'm getting a strange "Index (zero based) must be greater than or equal to zero and less than the size of the argument list" exception thrown when I trigger an event (atleast that's where I've tracked the problem to). This seems very strange to me since I'm doing no idexing here. I'm making a WebRequest, retrieving an XML document and parsing / serializing it to an object, then triggering an event to notify my Window.Form app that the data is available for display, however when I call my event passing it my custom EventArgs class I get the above exception.
I've played around a bit passing my EventArgs class different things and if I pass it a null (ie don't populate any of the data within it through a default cuonstructor the exception doesn't occur (this is of course useless to me caus I need the app to get this data). I've pretty much run out of ideas here ... could this be a known bug and I'm just late to the game? Has anyone else run into this? Am I missing something obvious (though this case is embarasing it's usually easily fixed).
I'm not sure posting any code will be very descriptive because it's distributed over so many classes, but some snipits follow:
// Delegate
public delegate void CMNMatchDetailsEventHandler(object sender,
MatchDetailsEventArgs a);
// EventArgs holding needed class
public class MatchDetailsEventArgs : EventArgs
{
public MatchDetails Response;
public MatchDetailsEventArgs(MatchDetails r)
{
Response = r;
}
}
.
.
// getting XML doc from web and serializing (using inherited method from an abstract class)
MatchDetails resp =
(MatchDetails)ExecuteGET(url, typeof(MatchDetails));
// calling event :: Passing my populated class to the EventArgs for my front end app.
MDetails(this, new MatchDetailsEventArgs(resp));
If I replace the "resp" class/parameter with null the exception does not occur, though the "resp" class contents are fully populated (I've dumped it to the console both before serializing the XML and after, everything appears to be intact)
I'm at a loss here.
Any help would be awesome.
Thanks in advance
- flip
|
|
|
|
|
Im over 90% sure that the class handling the event is raising the error. To track down the error source you should enclose the part where you trigger the event with a try catch block and look at the stack trace of the catched exception:
<br />
try {<br />
MDetails(this, new MatchDetailsEventArgs(resp));<br />
} catch (Exception exc) {<br />
Console.WriteLine(exc.StackTrace);<br />
}<br />
From the given output you will exactly get the source of the error.
|
|
|
|
|
Thanks for the quick respons Robert.
I probaly should have thrown in the stack trace, caus that might have been helpful. My debugging skills aren't what they should be but they're getting there.
Your post led me right to the source of the problem ... A+, Thank You and yet again I'm humbled
- flip
|
|
|
|
|
|
I would like to make changes to files that are stored in a specific windows directory for my application, and I know that it would require the usage of the foreach loop, but I do not know how to apply the syntax of how to access the files in the directory.
Here is what I think is the correct syntax. Please correct me. The error message is that it "cannot convert type string to System.IO.File".
using System.IO;
dirDirectory = "C:/directorypath/";
foreach (File fileName in Directory.GetFiles(dirDirectory))
{
fileName.
... processing (need to access the properties of each file)
}
Would appreciate assistance in establishing the correct syntax. While I realize that the foreach loop requires a specific file/control to evaluate and a collection of files/controls to follow the IN word, it doesn't seem to work here. It would seem to me that the GetFiles() method is a collection and should work. Why doesn't it?
The typical syntax is:
foreach (Control control in this.Controls)
{
... processing
}
|
|
|
|
|
It doesnt work because Directory.GetFiles return a string array and not a collection of File objects.
You have the following options:
1:
<br />
foreach (string fileName in Directory.GetFiles(dirDirectory)) {<br />
}<br />
2:
<br />
foreach (FileInfo fileInfo in new DirectoryInfo(dirDirectory).GetFiles()) {<br />
}<br />
|
|
|
|
|
Wow!!! Thanks, Robert Rohde. It worked!!! I prefer the second option because it more clearly demonstrates that the files are files and that the directories are directories as opposed to simply strings. I appreciate your assistance.
|
|
|
|
|
how can i use Sqlite with C#?
|
|
|
|
|
Google is your friend:
http://www.google.de/search?hl=de&q=sqlite+.net&btnG=Google-Suche&meta=
|
|
|
|
|
Hello,
do anyone know, how to create an ms installer for application1 when I click a button in an application2.
Please help,
Thank u
|
|
|
|
|
I am using a third party socket component for communication. My program should act as a client and i need to connect multiple hosts using this component. Can anyone suggest how to achieve this in c#.
|
|
|
|