Jump to content
Xtreme .Net Talk

liquid8

Avatar/Signature
  • Posts

    31
  • Joined

  • Last visited

Everything posted by liquid8

  1. This one is throwing me off.. Finally learning some stuff in DirectX and can't get by this one. Let me say right away that this works on 2 of my machines with GeForce cards. The card in this machine is an S3 ProSavage DDR (not the best but it what i have to work with) There is another machine with this same card and it happens on there as well. I have the newest drivers (that they offer at least) The text shows the first few letters/numbers and then just gets scrambled, whether i move to a different line, or continue on the same one. The rectangle i am using to draw on is stretched far enough, and it's not a font issue, as I can change fonts and see the different font for the first few letters. My question is this: Is there something I can check for that this card is not capable of doing, or is this just a driver issue with this particular card? Here's the shots to explain, thanks for any help in advance, LiQuiD8 [woops.. should be in DirectX forum]
  2. I am just learning D3D and I am having trouble getting the view matrix that I want. I have a mesh loaded at an X,Y,Z point. What I want to do is using a rotational view matrix that will rotate around the mesh. The rotation matrices (rotationX, rotationY, rotationZ) it seems only allow you to rotate from the camera angle, and not specify the rotational point. Any ideas what I am doing wrong? I did try adding a lookatLH matrix and a rotational matrix and it worked (sortof) but did some strange stuff to my model. LiQuiD8
  3. In case anyone needs to know how I did this.... I was using a typeconverter and overriding GetStandardValues, but I needed to return a dynamic list of items based on another property value... Here's what I did: Public Overloads Overrides Function GetStandardValues(ByVal context As System.ComponentModel.ITypeDescriptorContext) As System.ComponentModel.TypeConverter.StandardValuesCollection Dim obj As Object = context.Instance Dim DataValues as new ArrayList If Typeof(obj) is Label Then DataValues.Add("Text: " & obj.Text) DataValues.Add("Left: " & obj.Left) DataValues.Add("Top: " & obj.Top) Elseif Typeof(obj) is Bitmap Then DataValues.Add("Image") DataValues.Add("Height: " & obj.Height) DataValues.Add("Width: " & obj.Width) End If Return New StandardValuesCollection(DataValues) End Function The important part is the context.Instance - this allows you to retrieve information about the object that contains the property associated with the TypeConverter. LiQuiD8
  4. There may be a bit of math involved in this, or maybe there is an easier way... If I have a rotated string or a rotated picture with GDI, how can I determine the exact region of it.. normally if it isn't rotated you can just use: New Rectangle(me.left,me.top,me.height,me.width) I haven't dabbled with graphics paths yet.. would that make things easier? Thanks, LiQuiD8
  5. I have been searching and am still having trouble with this one... I may not have explained this very well... I have 2 values on a property grid. One of them I am trying to create a typeconverter that will return a standardvaluescollection, but the values it returns need to be dependant upon the value of the other property. Is there a way I can somehow pass a value to a typeconverter to accomplish this? Thanks, LiQuiD8
  6. Thanks for both of your suggestions.. both will come in handy.. LiQuiD8
  7. Actually, I realized as soon as I posted that this would involve Reflection... but if someone could post an example that would be extremely helpful.. Thanks again, LiQuiD8
  8. I want to loop through an objects properties to return their values, but the objects passed to the sub could be of different types. Isn't there a way that I loop through properties without actually knowing the properties, like: public sub LoopPropse(obj) If object.property.Count >= 1 Then For i = 1 to obj.property.count msgbox(object.property.item(1)) Next end function End If Maybe a poor example but hopefully you understand what I mean.. Thanks, LiQuiD8
  9. I have 2 properties on a property grid.. depending on the first ones value, i want to return one of two different enums.. For instance, I have a multiple data types (file, image, etc) and then i have enumerations for each... for File: location, name, size for Image: height, width, size if you change the first property to file, the other property should be a dropdown list of the file enums, if it is changed to image, the other property should change to be a dropdown list of the image enums.. How can I do this? Thanks, LiQuiD8
  10. you got it :) right now I just threw all the properties into the objects class, and used <category> Public Class BaseObject <Category("Appearance")> _ Public Property Opacity End Class but i would like to keep my appearance properties all in a seperate class LiQuiD8
  11. I may not have explained this well enough for anyone to answer. I sort of solved the problem, but not the way I wanted to. Basically I have a BaseObject Class, and want to have a seperate class with properties for Appearance, Data, etc.. The way I am currently doing this is: Public Class BaseObject Public Appearance as New Appearance End Class Public Class Appearance Public Property Font() as Font Public Property Color as Color End Class In Code, I create a new instance of the BaseObject: Dim newObject as new BaseObject I can successfully set all the underlying Appearance properties from the code, such as newObject.Appearance.Font, but setting the property grid to newObject, does not allow me to access the Appearance properties. Right now I just put all the properties in the same class, and Categorized them, but I want to have seperate classes for different property types. Any help would be appreciated. Thanks, LiQuiD8
  12. I am currently using a property grid to show the properties of a class Appearance. This has all the appearance properties of a BaseObject. I have an ObjectImage class that inherits BaseObject, and has its own Appearance class which shadows the BaseObject class. When I set up the property grid to show the properties for ObjectImage, it only shows me the BaseObject properties. What am I doing wrong? Thanks, LiQuiD8
  13. I guess that would explain why the error i was getting was object ref. not set to an instance of an object... i couldn't find what object didn't have an instance.. so I guess it was like you said, the existing row couldn't be used, so that was a bit confusing! woohoo! found what I needed though... the ImportRow method of a DataTable lets you import a copy of an existing row. After that, all I had to do was this: Dim DR As DataRow For Each DR In NewRows CurrentData.Tables(0).ImportRow(DR) Next thanks for the help! LiQuiD8
  14. The Select method looks like it will do great for what I need to do (just sort records alphabetically by a certain column, filter for specific records) I am having some trouble with getting that to work, my data goes into the datarow array fine if i use no filter query, but i am getting errors otherwise. The other problem I am having is putting the returned rows into a dataset. Shouldn't I be able to do something like this: Dim newDataset as dataset newDataset = myDataset.Clone Dim rows as DataRow() rows = myDataset.Tables("Table1").Select("","FirstName") For each DataRow in rows newDataset.Tables("Table1").Rows.Add(DataRow) Next Thanks for the help, LiQuiD8
  15. I am currently reading data from an xml file into a dataset. In order to sort this data, would I just use a standard SQL statement or is there an easier way to sort/filter this data to return a sorted/filtered dataset? Could someone give a me quick example of using an SQL statement with a dataset if that is the way I should go about it? Thanks, LiQuiD8
  16. after a few nights of trying with ShowWindow, setforegroundwindow and a bunch of other API calls, the best I can do is still just get it to focus on the application, but not open it up. I have it working right now, sending AppActivate and using system.threading.thread.wait(700), then sending enter with sendkeys, but I don't want to rely on this method. I looked into using SendMessage, but how would I go about using it to change the windowstate? Also, how come most of the sites that show how to do api stuff don't tell you what the constants are? They show you the code with WA_RESIZE or whatever but they don't tell you what it is supposed to equal. The code is pretty much useless without that. Thanks again, LiQuiD8
  17. I have been trying to use ShowWindow but was having some problems with it. I will try a few of these suggestions tonight and let you know the outcome. Just wondering, the VB.NET counterparts to these functions are all under system.windows.forms - i take it you can't pass another applications handle to these? Oh, and getting the handle of the app is not a problem. I am starting the app with process.start which has a function to return the handle. Thanks, LiQuiD8
  18. appactivate i am trying to use appactivate to return focus to an application run by a process. When the application is in a window, it works fine, however, since the application that i am using goes to fullscreen, it will not completely return focus. The task gets focus in the taskbar, but it does not return back to fullscreen. Is there another way I can do this, or a way with appactivate? I am trying to avoid using sendkeys. Thanks, LiQuiD8
  19. got it.. all i had to do was [form].activate, although for anyone that needs it, i did have to check if the form was minimized, otherwise changing focus back to it crashed out. So I just did this: If CurrentForm.WindowState = Windows.Forms.FormWindowState.Minimized Then CurrentForm.WindowState = Windows.Forms.FormWindowState.Normal End If CurrentForm.Activate() LiQuiD8
  20. I am launching another application using microsoft.visualbasic.shell, and I am using a hotkey control that will register when a key is pressed. Now I need to return focus to my application when that key is pressed. The hotkey event does fire when the key is pressed but does not return focus to my application. How can I do this? I am using VB.Net if that makes a difference in code. Thanks, LiQuiD8
  21. Worked perfectly... thanks divil! :) I knew that function had to be in there somewhere.. liquid8
  22. I am having some troubles getting my mouse overs in the correct location when using scaletransform. I am using regions to check if the mouse is over a certain drawn image or text. It seems the way i have it now that the regions are scaling correctly, but they are to the left and right of where they should be at. DesignWidth/Height is the width/height the screen/form is designed to be at, CurrentWidth/Height is the screen/forms current width/height In Paint: scaleX = CurrentWidth / DesignWidth scaleY = CurrentHeight / DesignHeight myGraphics.ScaleTransform(scaleX, scaleY) Public Function HitTest(myObject as Object, x as point) as Boolean Dim rect As New Rectangle(myObject.LocX * scaleX, myObject.LocY * scaleY, myObject.Width * scaleX, myObject.Height * scaleY) If rect.Contains(x) Then return True End Function MouseMove calls HitTest() I was reading about converting the Mouse Position to the Client Position, but only saw code for C, no VB code. I have tried compensating for the desktop location of the form, and that works until it is scaled to a different size, then the positioning is off again. Am I missing something that I should be compensating for? Thanks, liquid8
  23. I had the same problem, and I did download the vb.net version of the SDK... I'm gonna try the full SDK tonight... LiQuiD8
  24. the program that i am working on now has different graphical object over a complete screen. Anytime an item is "mouse-over", I only redraw that region, don't know if it is just me but I get full cpu usage when i invalidate() in the paint event even when using double buffereing.. you can do this by using invalidate(regoin) - this made an enormous difference in speed and cpu usage. Use seperate regions for your chess pieces and just redraw the one that is being moved at the new mouse location. LiQuiD8
  25. Is there a simplified way to create global hotkeys in .Net or do you have to go through api calls? I have seen a few ActiveX controls for this, but I would like to steer clear of them if possible. I want to be able to launch an application, but using a global hotkey returns back to my application... Thanks, liquid8
×
×
  • Create New...