Jump to content
Xtreme .Net Talk

mutant

*Experts*
  • Posts

    1922
  • Joined

  • Last visited

Everything posted by mutant

  1. Picturebox1.Image = Image.FromFile("path")
  2. You can reference another project only if its a DLL. You will not be able to reference another project that will build into an EXE.
  3. Use the System::Windows::Forms::Clipboard class which contains static method to put and retrieve items to/from the clipboard. System::Windows::Forms::Clipoard::SetDataObject(yourbitmapobject, true) The second argument specifies if the object will remain in the clipbaord after the application exits.
  4. Windows is a message based based OS. Every application receives a message from Windows when something happens that would conern a specific window window. For example when you press the little X button on the top right of the window, Windows sends a message to the application telling it that you want to shut down the application. Now if the application is nice enough it will shut down, or if its evil it will keep going against your will ignoring the message. Another example of a message is WM_PAINT message which is sent to the window when it needs to redraw itself, thats how you get the Paint even in your .NET programs, the window receives the paint message and raises the Paint event for you. .NET Framework is nice enough to handle the message loop for you but if you want you can still help it process the messages by overriding the WndProc method of the Form.
  5. Forum is not unactive, some people simply don't know the answer or don't notice a particular thread :). You could generate hashes of the files using some of the cryptography classes which make it easy to make a hash from an IO stream. All you would have to then do it compare the results. This method is used a lot to check downloaded files for corruption (mostly by the open source community). An example: 'create a new object that will compute the hash for you Dim h As New Security.Cryptography.MD5CryptoServiceProvider 'declare an array of bytes that will store the produced hash 'The ComputeHash method takes an IO stream as an argument, just what you need Dim res As Byte() = h.ComputeHash(New IO.FileStream("path to the file", IO.FileMode.Open)) 'decode the bytes if you want so you can easily compare them later MessageBox.Show(System.Text.ASCIIEncoding.ASCII.GetString(res)) This should work for you as in theory no two different sets of data can create the same hash, but some people are trying to disprove the theory :).
  6. It affects the application in the way PlausiblyDamp already told you :). The method will start a message loop for your whole application. It won't be started on the new thread as you said, to see that use the Application.Run method with a form and put some code after the call, the code after the method call will not be executed until the form is done. Basically Application.Run will start a message loop like you would create by yourself in C++.
  7. If you post a thread and find the answer by yourself, the thread can still be useful if you post the solution to your problem. Someone who is searching can find it later.
  8. Ah, using DrawImage is better here is how you can do it. 'create a new bitmap that you will put the scaled version of original on Dim newimg As New Bitmap(320, 240) 'pic the size you want Dim gr As Graphics = Graphics.FromImage(newimg) 'get the graphics for it 'now load the original and draw it onto the new bitmap gr.DrawImage(New Bitmap("path to the original picture file"), 0, 0, 320, 240) newimg.Save("new file name") gr.Dispose() 'never forget this step :)
  9. See this thread for some suggestions: http://www.xtremedotnettalk.com/showthread.php?t=84824
  10. Try some sites like this: http://www.rentacoder.com/
  11. If you want to read command line arguments take a look at System.Environment.CommandLine property, or System.Environment.GetCommandLineArgs method.
  12. If you want to resize the picture then use the GetThumbnailImage method of the bitmap object.
  13. Depends on how your file is structured. Mind giving an example?
  14. Its not working but its not hard to fix :). First of all, you are wasting time by creating a new blank bitmap, and then creating a new one again from the file. Load it directly from the file. Dim myimage As New Bitmap("file path") Im assuming you are doing this in the paint event of an object (form, picbox etc.) since you are using e.Graphics. Well, to draw to your newly created bitmap you dont need that graphics object. You were going in the right direction with this line: g.FromImage(myimage) But that is not excatly what you need. The FromImage returns a graphics object, it doesn't make replace the object you call it from since it is a shared/static method. And since its shared you can also call it using the class name: Graphics.FromImage. This is how you can get the Graphics object for your bitmap: Dim g As Graphics = Graphics.FromImage(myimage) Now you can draw onto the bitmap you just created and later save it.
  15. Use a for loop and add the handler in it.
  16. Do you have any reason for using UInt32? Its not a CLS compliant data type.
  17. http://www.xtremedotnettalk.com/showthread.php?t=70671 You could also research WMI on MSDN if you feel like it :).
  18. Try chnaging the As Long to As Integer. VB6's Longs are now the same size as .NET's Integers.
  19. You can do it the way all modal dialogs in .NET do it. Set up properties and private variables that will be retunred through the properties, when the dialog is closed you will be able to access the properties of the form because unlike normal forms, modal forms are not disposed when the Close method is used on them.
  20. Whhat do you mean it doesn't work? Do you want it to return a string with the day name instead of a number? Then declare your variable that stores the result as DayOfWeek enum. Dim f As DayOfWeek f = DateTime.Parse(Now.Year.ToString() & "/" & Now.Month.ToString() & "/01").DayOfWeek Then you can use the ToString method of the DayOfWeek variable to return a string representation of the day.
  21. You can't create one assembly (exe or DLL) using more than one language with VS.NET (any edition). If im not mistaken its possible using some advanced command line compiler options.
  22. The code would remain the same. The big difference between the two is that VS.NET Pro allows you to work with all of the four official MS's .NET lanyguages: VB.NET, C#, MC++/C++, and J#. You can sell the software made in Standard, the only license that does not allow it is VS.NET Pro Academic. You can get more info here: http://msdn.microsoft.com/vbasic/howtobuy/choosing.aspX
  23. According to the documentation EnableVisualStyles is not available in .NET 1.0. So you have to try with the manifest.
  24. mutant

    Date Format

    Because "mm" represents minutes.
  25. mutant

    Date Format

    Try this format: "dd/MM/yyyy"
×
×
  • Create New...