Jump to content
Xtreme .Net Talk

Darc

Avatar/Signature
  • Posts

    93
  • Joined

  • Last visited

Everything posted by Darc

  1. here, I did my own GDI+ Drag-and-drop system for a card game: Dim LastMousePos as New Point(0, 0) Dim CurrMousePos as New Point(0, 0) Private Sub pbx_MouseDown(Byval sender as object, byval e as MouseEventArgs) Handles pbx.MouseDown LastMousePos.X = CurrMousePos.X LastMousePos.Y = CurrMousePos.Y CurrMousePos.X = e.X CurrMousePos.Y = e.Y End Sub Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs) Dim g As Graphics = e.Graphics Dim pn As New Pen(Color.Black, 3) g.DrawLine(pn, LastMousePos, CurrMousePos) End Sub It's late here, I hope this works.
  2. try something like: Private SavedImages() as Bitmap Sub SaveToImages(Byval imageToSave as Bitmap) Redim Preserve SavedImages(Ubound(SavedImages + 1)) SavedImages(Ubound(SavedImages + 1)) = New Bitmap(imageToSave) 'Call this every time you save an image, then they're all stored in an array for you End Sub
  3. I got started with a Step by Step book... the "Learn ___ in 21 days" series is really good as well. If you need any help contact me on msn, tzodem @ hotmail.com
  4. I'm not completely sure on this one, (have VC++, have yet to use it): void GetGUI(System::Windows::Forms::Control * hostcontrol, System::Windows::Forms::Control * displaycontrol) { //Insert code here } Byref is just like declaring an argument as a pointer, I hope this helps
  5. I started programming 6 months ago (I just turned 14). I can program fairly fluently, VB 6, VB .NET and C++ (managed and unmanaged) I can also use DirectX 7, 8, 9 and I've learned most of the .NET API
  6. well the program I use this for does this function about 1 000 times on average per frame. the C++ portion is returning arY, that's it
  7. oh, arY, arHeight and crdHeight are integers in both, and NumCards and crdNum are longs in both. The Function returns an integer
  8. I had a simple mathequation that I thought I might speed up using a Win32 DLL but it's returning a different value than in VB (the one that I hoped for). Here's the code in VB (the one that works) and the code in C++ (which returns a bad value): Dim y As Integer = CInt(arY + (((arHeight - crdHeight) / NumCards) * crdNum)) //C++ VS 2003 return arY + (((arHeight - crdHeight) / NumCards) * crdNum);
  9. I'm just using it in a couple places for boosts of speed (simple square images) just a question, how can I convert the integer's to IntPtr, ReleaseHDC doesn't have an overload for Integer
  10. I can't open the files :P
  11. ok, I tried the following but it gave me: An unhandled exception of type 'System.InvalidOperationException' occurred in system.windows.forms.dll Additional information: The object is currently in use elsewhere. here's the code: Public Sub Blt(ByVal img As Image, ByVal e As Graphics, ByVal rct As Rectangle) Dim graph As Graphics = Graphics.FromImage(img) Dim imgHDC As Long = graph.GetHdc.ToInt64 Dim hdc As Long = e.GetHdc.ToInt64 Dim retval As Long retval = BitBlt(hdc, CRD_AREA.X, CRD_AREA.Y, CRD_AREA.Width, CRD_AREA.Height, imgHDC, 0, 0, &HCC0020) graph.Dispose() End Sub
  12. I don't have C#, I have VB and C++. btw, for using bitblt, do I just use GetWindowsDC(Me.Handle) or something like that?
  13. hey, this kinda falls under interop too, but I wanted to know if GDI (BitBlt) would be faster than .NETs GDI+. I found a way to use old GDI with C++ .DLLs so would it be faster under C++?
  14. ok, got a prob now, works fine when I use it on my computer but on some peoples computers it gives them an Unknown Error exception could this be triggered by a Firewall?
  15. nm, I figured it out, thanx
  16. yes I would like the code to a Binary transfer
  17. hey, I'm working on a project that is updated constantly, and I don't like using MSN or e-mail or whatever to send the file to everyone who needs it. I've set up basic Socket Chat servers before but I'm completely oblivious to the rest of the Net Namespace (cept for WebClient.DownloadFile :)) Can you transfer a file over Socket servers? thanx to all those that help
  18. I just wanna load a text file from a website, so I can quickly update the News Screen on a game I'm working on. I don't have any database tools so text is gonna hafta do. I tried something like: Dim sr as new StreamReader(*insert address of TXT here*) but it gave my a URI Encoding is not Supported error. Any help?
  19. I'm using the PictureBox's image property
  20. I used this DirectDraw 7 with VB 6. What its supposed to do is it goes through all the pixels of two overlapping images, and any of the pixels are NOT transparent on both images, it would signal that they have collided. Now I want it in GDI+/VB.NET :) I tried it using the GetPixel Method in the Bitmap class, but every time I try to get a Bitmap from a PictureBoxes image, it gives me the "Object Reference not set to an instance of an Object" error. Any help ppl?
  21. I'm working on a game, and I have a splash screen on load. So far all it does is say what its doing, but what I want it to do is make the text of what it is doing fade in and out (using the Alpha setting in FromARGB) but I can't change it since its too busy loading. Is there a way to do multithreading in VB .NET to do this?
  22. you could get the width of text in pixels, making it possible to center text.
  23. is there a .NET equivalent of TextWidth from VB 6.0? I need to center some text...
  24. No, the KEYWORDS on the cards :) Like, Creature or Building, they're just status of the card so I need to have more than one on a card (like "Strong" and "Creature")
  25. I'm making a Online Card Game with MANY keywords (think MTG) And I don't want to make literally 50 boolean properties and arguments per function...
×
×
  • Create New...