Jump to content
  • Advertisement

Cutman

Member
  • Content Count

    13
  • Joined

  • Last visited

Community Reputation

122 Neutral

About Cutman

  • Rank
    Member
  1. Ah, that does work! Excel can actually parse simple text files delimited with commas...I had no idea it could do that. Thanks!
  2. Thank you very much. I'll give it a shot.
  3. I've been having a problem - I need to save my data in .xls format. However, I am only finding ASP and ADO .NET tutorials. I just want to know what libs to import, how to open a file, how to put data in it, and how to save. I don't care about other properties like centering etc. I've spent the last two hours looking, and I am coming up short. VB.NET preferred, but I do C++ in the Framework too. Thanks
  4. Good luck, I hope that helps. :)
  5. OK, maybe my question was a little cryptic. If you want to save images to bitmaps that way in VB.NET: ' create your bitmap dim bmpPiece as new bitmap(width, height) ' create a graphics object dim BitmapGfx as graphics = Graphics.FromImage(bmpPiece) ' now get the dc using the graphics object you created... dim BitmapHandle as intPtr BitMapHandle = BitmapGfx.GetHdc() ' You won't see GetHdc listed as a method in the intellisense window, ' but it is there. ' now that you have the handle, use bitblt() to copy your images ' don't forget to release that dc when you are done BitmapGfx.ReleaseHdc(BitmapHandle)
  6. Have you tried using bitblt()?
  7. Solved it. If anyone has a similar problem: Don't try to save in the same sub from the object that has the hRC, because there are pipelining issues (that's my guess), and you are likely to get the data only after gl.glClear() erases the data. It is much better to use bitblt() to copy to a bitmap, then invoke that bitmap's Save method in a different sub.
  8. Hi guys, I have a question about Tao: You can get a device context to a PictureBox very easily (PictureBox.Handle), and set up a rendering context to it. However, I can't seem to find a way to render to an off-screen bitmap. I tried creating a graphics object and using GetHdc(), but problems abound. Anyone have example code?
  9. I give up. I just looked at the hex dump for the images I am getting. They are really corrupted. I am just going to bite the bullet and find another way.
  10. Cutman

    [.net] OpenGL in .NET

    I got Tao to work after a lot of effort. Just get the .NET 2.0 Framework installed, and then put the libs and dependencies where they belong. There are sparse examples, but you can find them. The whole reason I left the safety and comfort of VB and C++ in unmanaged code is that I need to make sure that my products will run on Vista. I am a little worried about the device drivers I wrote for USB. I want to stick to the managed code philosophy so I can keep up with the coming changes. Does anyone know if Vista will have easily accessed OpenGL functionality? I heard the GUI will use OpenGL...
  11. OK, here is exactly what I am trying to accomplish: I am taking data in through the parallel port. This data is then processed and displayed using Tao. The image is correctly being drawn to a PictureBox on a Windows form. When the user clicks the image, it is supposed to save it. However, there is a problem. The Image member in the PictureBox object isn't getting the data. Somehow, OpenGL is rendering to some internal private member in my PictureBox that I can't get to. For example... PictureBox1.Image.Save("my_shiny_new_bitmap.bmp") ...simply won't work. The Image member is set to 'Nothing', and the program throws. So to get at the image, I have decided to use the GDI function bitblt(). This seems to work when I transfer the image to a bitmap, then transfer that to another picturebox using... PictureBox2.Image = mybitmap I didn't need PictureBox2...it was just to check that the image was being transferred. The bitmap was saving totally black images, so I was checking to see if the image data was there with different PictureBoxes - and it is. Anyway, when I go to save either the temporary bitmap OR PictureBox2.Image, I get a completely black bitmap. I have tried just about every way I can think of to get around this problem, but since I am new to the .NET way of doing things, I'm not sure. Anyway, I hope that clarifies my problem.
  12. I've been having some problems saving images from a picturebox that OpenGL renders to via Tao. Here is the code: Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click Dim pic_g As Graphics = PictureBox1.CreateGraphics Dim mybitmap As New Bitmap(PictureBox1.Width, PictureBox1.Height, pic_g) Dim bmp_g As Graphics = Graphics.FromImage(mybitmap) Dim pichdc As IntPtr Dim bmphdc As IntPtr pichdc = pic_g.GetHdc bmphdc = bmp_g.GetHdc BitBlt(bmphdc, 0, 0, mybitmap.Width, mybitmap.Height, _ pichdc, 0, 0, SRC_COPY) PictureBox2.Image = mybitmap PictureBox2.Image.Save("mypicz.bmp") pic_g.ReleaseHdc(pichdc) bmp_g.ReleaseHdc(bmphdc) End Sub OK, here is the weirdness: bitblt indeed copies the image to mybitmap from picturebox1, because when I set picturebox2.image to mybitmap, it works. There is data there. But when I invoke picturebox2.image.save() or mybitmap.save(), it saves a black bitmap - all the color data goes bye-bye. Is there something I'm missing here? What is happening to the color data?
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!