|
FYI - your link does not work.
I'm not clear on Rule_Prio or Level but here's one thought:
Make sure the list is sorted such that the parent nodes come before child nodes. e.g. in your list "HeavyTruck" is listed before "Truck" has been added to "Vehicle".
Use Typename to find the parent node.
Add current item as child to parent node.
It is relatively slow since you must find the parent for each addition.
Good Luck.
|
|
|
|
|
Ok thx.
I corrected the link. But i'm not able to get the priority into this.
|
|
|
|
|
Not sure I understand you. Are you having difficulty adding the priority node to its parent node? Why?
|
|
|
|
|
hey,
i want to make a window that will dynamically generate the copy of background application,, mention you i wana generate dynamic copy , so that i can make changes in that copied window...... whenever the window is draged n droped it should create the copy of background which it is covering....
plz help me... i m in real need
sushant kaura
sushant kaura
|
|
|
|
|
hi,
Any body please give me information ,About
collection class . And its interfaces implementations.
(or) where i found ?
|
|
|
|
|
|
thank you for providing information.
|
|
|
|
|
Hi guys
I have a problem when I use an Add-in to word, I want to get the filename / path of opened document.
(i.e i have a opened a document in word, now when i click my button it should return the filename / filepath of opened word document.
Thank you!
M. Nauman Yousuf
|
|
|
|
|
How do i get the byte[] associated to the System.Drawing.Bitmap class???
a fast and helpful answer is requier
KainPlan.
|
|
|
|
|
|
Yeah i know this... it works... but the display works with 8 bit per pixel and the result of viewing the bitmap is not what it meant for. (sry for bad english) I need to Convert the Bitmap or the array but it all happens in a rendering thread at 10fps and a convert like this:
for (int y = 0; y < bmp.Height; y++)
{
for (int x = 0; x < bmp.Width; x++)
{
byte b = 0;
if (bmp.GetPixel(x, y).B < 128)
b = 128;
arr_bytes[i] = b;
i++;
}
}
is too slow.
Edit:
(if b >= 128 the display draws a black pixel.)
|
|
|
|
|
Use System.Drawing.Bitmap.LockDIBits() and System.Runtime.InteropServices.Marshal.Copy
|
|
|
|
|
yeah this works too!!! but its the problem of the 8bits again...
the Display works with 160x43x1 how to convert the 160x43x4 that its shown correct on the display...
Its in a rendering Thread, means no slow actions like for or while loops. i need something like to get only every 4th bit of the array i think... 32bpp to 8bpp...
Or maybe first convert the System.Drawing.Bitmap from 32bpp to 8bpp and then Marshall.Copy the bytes..
Any ideas??? Sry for bad english
|
|
|
|
|
AHHHHH!!!!!! I GOT IT
//Preform bit reading of bmp.
Draw.Rectangle rect = new Draw.Rectangle(0, 0, bmp.Width, bmp.Height);
System.Drawing.Imaging.BitmapData bmpData =
bmp.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadWrite,
bmp.PixelFormat);
IntPtr ptr = bmpData.Scan0;
int bytes = bmp.Width * bmp.Height * 4;
byte[] rgbValues = new byte[bytes];
//Marshal copy the bits at ptr to rgbValues at 0 for a size of bytes.
System.Runtime.
InteropServices.Marshal.Copy(ptr, rgbValues, 0, bytes);
bytes = bmp.Width * bmp.Height * 1;
byte[] bValues = new byte[bytes];
int i = 0;
//Convert into a Displayable kind.
while (i != bytes)
{
bValues[i] = rgbValues[i * 4];
i++;
}
lgbmp.pixels = bValues;
a little bit worse but it works with no timing issues!!!
|
|
|
|
|
I'm not interested in simple solution of getting the url and opening IE from process.start(IE,url)
the closest thing i had in mind is : when i right click the link from axWebBrowser and choose "open in new window" it opens it in new IE window, so I'm looking for a way to imitate it somehow and perform the same action on left mouse click on that link (and it will open a new IE window), like re-routing from axWebBrowser into IE.
again, im not interested in the url that is being opened on "open in new window" its more complicated than that, thats why I'm looking for a way to "re-route" from axWebBrowser into IE.
thx ahead!
|
|
|
|
|
Hello experts,
I'm pondering on the matter for some time now...
How can I tell which object types are managed types, and which are unmanaged?
I was writing a Dispose(bool disposing) method for one of my classes, and the question poped up...
protected virtual void Dispose(bool disposing)
{
if (!disposed)
{
if (disposing)
{
}
}
disposed = true;
}
How do I know which objects should be disposed of in the if (disposing) {...} block?
I guess a FileStream and maybe other streams are unmanaged and should be disposed outside of the block.
What about sockets, timers, etc.?
How to tell??
Thanks in advance,
Shy.
|
|
|
|
|
You should treat any class that implements IDisposable as containing unmanaged resources.
Some classes, like for example MemoryStream, does implement IDisposable eventhough it doesn't contain any unmanaged resources. You should dispose of it anyway, partly just to follow the pattern, but also because the memory management works better if you dispose of all disposable objects.
---
single minded; short sighted; long gone;
|
|
|
|
|
So what should the if (disposing) { ... } block contain?
Should I simply set each non-disposable object to null?
|
|
|
|
|
If an object implements IDisposable , then it most probably implements a finalizer too. In that case, you cannot call Dispose outside the if (disposing) {...} block. The unmanaged resource cleanup is only for unmanaged resources that don't have a Dispose/Finalizer (things like handles you opened yourself).
protected void Dispose(bool disposing)
{
if (disposing)
{
}
}
|
|
|
|
|
That code block is used for anything that you have to do to put your object into an unusable state, as an object is not supposed to be usable after it has been disposed.
You don't have to dereference objects. When the last reference to your object goes away, the references that it contains doesn't count any more.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi, all!
I'm interested in statistics on:
1) How many .net framework downloads have occurred in total?
2) How many .net developers are known to exist?
3) What's the distribution of answers for questions 1) and 2) between various .net versions?
There should be microsoft statistics I believe. But can't find it. Please, provide if you know.
If there are such statistical data not from microsoft, then please provide me as well.
Thank you, folks.
|
|
|
|
|
I'm trying to port a C++ algorithm to C#, and Im ust say, this is my first time doing so.
Would anyone care to list the corresponidng types from C++ to C#? I've already made some guesses as to what they are:
size_t (I assume it is System.Int32)
uchar_t (I assume it is System.Byte)
uint16_t (UInt16 definitely)
Also, I don't think C# can have the void type in a method's parameter list.
Method(void *sStart, size_t sLen, void *dStart, size_t dLen)
This one line has me puzzled.
Thanks in advance.
ROFLOLMFAO
|
|
|
|
|
You can use as Object
Parwej Ahamad
g_parwez@rediffmail.com
|
|
|
|
|
If possible, I would like to avoid object. Object doesn't even make sense since they are all value types.
ROFLOLMFAO
|
|
|
|
|
Ok, you can use void * pointer in c#
Parwej Ahamad
g_parwez@rediffmail.com
|
|
|
|