CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Dan_H

Page 1 of 28 1 2 3 4

Search: Search took 0.93 seconds.

  1. Replies
    2
    Views
    773

    Re: color picker problem

    The first problem with media files will be due to hardware acceleration. Pixel data is not handled by software but is passed directly to the video hardware for rendering, allowing for faster pixel...
  2. Replies
    2
    Views
    912

    Re: Line Number

    You're almost there yourself, just need to add the length of the selected text to the start of the selected text, so


    rtb.GetLineFromChar(rtb.SelStart + rtb.SelLength)
  3. Replies
    10
    Views
    1,272

    Re: A question with function

    I am guessing that you have a custom messagebox, otherwise its just a matter of calling the standard msgbox within the function and interrogating the response directly in the function.

    With your...
  4. Re: How to distinguish right click and right double click?

    You have to implement a custom routine using a timer to enable right-double click. Try this:


    Option Explicit
    Private n As Integer
    Private DRCSensitivity As Integer

    Private Sub...
  5. Replies
    56
    Views
    6,235

    Re: How to Allow a User to Crop an Image

    I'm not too clued up when it comes to activeX objects, but luckily VB6 comes with a splendid little Wizard - the ActiveX Control Interface Wizard. Goto the Add_Ins menu, select add_in manager, and...
  6. Replies
    56
    Views
    6,235

    Re: How to Allow a User to Crop an Image

    I don't have VB with me at the minute but do we not assign to the picture property?


    Pic1.Picture = Pic2.Picture

    If that is actually an image control you're using, I hardly ever use them so...
  7. Thread: timer question

    by Dan_H
    Replies
    8
    Views
    1,074

    Re: timer question

    Rather than using a second timer, just increment a form level variable in your timer procedure, and get the timer to disable itself when the variable reaches a certain value. The exit value will...
  8. Thread: Text Box Control

    by Dan_H
    Replies
    3
    Views
    903

    Re: Text Box Control

    Even shorter, use Mid$ to remove the first character


    Text1 = Mid$(Text1, 2)

    I also prefer to be strict and use Left$, Mid$, Right$ etc which enforce variable type. Without the dollar sign...
  9. Replies
    4
    Views
    782

    Re: Help with grouping labels?

    Creating a control array of labels for each group would be one way to do it.

    Add a label to a form, give it an appropriate name, say lblMetalloids, then copy it. Hit paste and VB will ask you if...
  10. Replies
    56
    Views
    6,235

    Re: How to Allow a User to Crop an Image

    I've been getting lazy in your absence Gremlin!

    Storing the last known X and Y coords is a much better way of drawing than using CLS. I think I've been picking up some bad habits while you've...
  11. Replies
    56
    Views
    6,235

    Re: How to Allow a User to Crop an Image

    I saw this earlier and though I might build a little demo; whilst I've been coding more posts have been added, but not wanting to see all my hard work go to waste...

    Cropping can be done fairly...
  12. Replies
    2
    Views
    732

    Re: Cant keep a score with 4 option buttons

    I think you need an array to store whether a question has been answered correctly or not. I'd use a boolean array.

    You can evaluate the answers in each click of your option buttons, or in the...
  13. Replies
    9
    Views
    1,566

    Re: Application Freeze

    The End statement is not good at all. It terminates your program without invoking the unload event of your form, thus any clean up code you might have in there does not get executed.

    You should,...
  14. Thread: Mouse Control

    by Dan_H
    Replies
    6
    Views
    1,360

    Re: Mouse Control

    It is fairly easy to move the mouse around with the SetCursorPos API. You can execute this in a timer to float the pointer around, or pass values to it directly to get it to jump.

    Gettting the...
  15. Re: Changing the Image on a Button on a Toolbar

    The imagelist must be bound to the toolbar in the property pages of the toolbar, then you just assign the index value of the image in the imagelist you want to display, so
    ...
  16. Re: How do I... Add code to objects that don't even exist yet?

    Instead of using the Controls.Add method - use a control array. You can add to the array dynamically, and code for one control works for all the controls in the array - you just have to handle the...
  17. Thread: copy array

    by Dan_H
    Replies
    2
    Views
    1,431

    Re: copy array

    Declare the array you are copying into as dynamic, then simply assign the array you want to copy to it. As an example

    Dim MyArray(5) As Long
    Dim Array2() As Long, n%

    For n = 0 To...
  18. Re: Does the height of a form include the height of its title bar?

    The height property of a form does include its titlebar. It gives a value in twips from the top of the titlebar to the bottom of the lower border.

    A form's scaleheight gives the interior height...
  19. Replies
    4
    Views
    1,113

    Re: Picturebox (Graphic)

    Here's a quick demo to show circles aswell. Its not as easy as it sounds for circles; I like to use the hypotenuse method for calculating the radius based upon the starting coordinates at mousedown...
  20. Replies
    5
    Views
    1,369

    Re: simple CaptureWindow to Clipboard help

    The code looks good, and I can copy screen images to the clipboard sucessfully using very similar code. I am assuming that you are obtaining the handle value (hwnd) elsewhere - the only issue I can...
  21. Replies
    37
    Views
    11,261

    Re: GrayScale In VB 6

    Thanks for the luminance reminder rbamforth; I have seen this before but I didn't realise that luminance weightings would also affect greyscale. I adjusted my code to use these values and there is a...
  22. Replies
    37
    Views
    11,261

    Re: GrayScale In VB 6

    Ah - I do love graphics programming!

    I've never actually done a speed comparison on the various graphics methods for image manipulation, so here we go.

    Paytor, I think this shows the speed of...
  23. Replies
    37
    Views
    11,261

    Re: GrayScale In VB 6

    @Wof - Indeed the old type coercion issue it is (yoda writing ?!). I'd forgotten 32767 is the integer max - 2 bytes to the integer, 15 bits, the 16th for the sign.

    So VB thinks &HFF00 is an...
  24. Replies
    37
    Views
    11,261

    Re: GrayScale In VB 6

    I don't have VB to test at the minute, but does the first one not require a second ampersand - &HFF00&

    I'm sure I saw an overflow error when I had forgotten the second &, suggesting a type...
  25. Replies
    37
    Views
    11,261

    Re: GrayScale In VB 6

    To answer your first question, if you have true greyscale images then you can indeed just store 1 value that you can later replicate across the 3 RGB elements when loading the picture back.

    I am...
Results 1 to 25 of 680
Page 1 of 28 1 2 3 4





Click Here to Expand Forum to Full Width

Featured