Jump to content
Xtreme .Net Talk

IngisKahn

Avatar/Signature
  • Posts

    436
  • Joined

  • Last visited

Everything posted by IngisKahn

  1. Object Browser is your friend. :) Use FromARGB(int)
  2. Generics have many many uses beyond collections.
  3. IngisKahn

    Sleep

    IMO a timer would be a much nicer solution. Sleeping a GUI thread is never a good way to go. Anyway, the problem is that your program can't paint itself while it's sleeping. DoEvents or a call to Paint would help a bit.
  4. Repent from your old VB6 ways! Use Debug.WriteLine instead. :)
  5. Hmm, maybe a more detailed description of your requirements would help us help you. :) The GDI+ Brush is very flexible. Perhaps PathGradientBrush or TextureBrush could be used. Do you need the colors to change after the line is initially drawn? Sounds like a job for a DX Pixel Shader! :p
  6. I wouldn't go that far... Would creating a Pen using a gradient Brush solve your problem?
  7. Yes, check out the sample framework in the sdk.
  8. Sounds like a perfect application of sprites...
  9. In DX it's called MultiSample.
  10. Yes if your class uses unmanaged data or disposable objects. Look up IDisposable in MSDN.
  11. The World matrix is a transform thru which all vertices must pass; it maps vertex coordinates to world coordinates. Really you should use the View matrix to handle the rotation of the graph.
  12. 1. Yes (see marble's link) and 2. Yes, you can add .NET or COM references.
  13. You have to use ByValTStr on fixed length strings that are not null terminated.
  14. There are only 4 characters in the string, the null just marks the end.
  15. Try using LPStr instead of ByValTStr or you can set the CharSet of the StuctLayoutAttribute to Ansi.
  16. C'mon dude, you've been here long enough. There's a section for XML/Database. :p
  17. First off the bytes FF D8 equal the number 0xD8FF so I'm not shore what your problem there is. How are you reading the four CC in? Remeber that in .NET, Strings are unicode strings not a null terminated array of bytes like in C.
  18. Using short or ushort dosen't really make a difference. The short will just show up as a two's compliment negative number.
  19. Are you reading this from a stream? Just use BinaryReader.ReadInt16() in that case. But anyway, here's 2 ways to convert a byte[2] array into a short: short s = (short)((b[1] << 8) | b[0]); or in an unsafe block: fixed (byte* pb = b) s = *(short*)pb;
  20. Sure there's a number of ways to do it. You can shift and or them together or better yet use a pointer to copy the value. But the real question is why is SOI a byte array in the first place? It seems better suited to be an int or short. Generally you shouldn't expose arrays publically anyway.
  21. Yup, that's the standard MO.
  22. Just taking a quick scan I see you're creating a brush without disposing it. Use Brushes.Black instead.
  23. Writing a BitStream class is no big deal. It took me less than an hour. I'd post it, but I don't own the code. :( But feel free to ask any questions.
×
×
  • Create New...