Results 1 to 15 of 15

Thread: [RESOLVED] how to place the image of an object in the form?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2013
    Posts
    148

    Resolved [RESOLVED] how to place the image of an object in the form?

    I have this picturebox cotrol and this another control lets say button2.

    I would like to click on button1 and capture the image of button2 and place that on the picturebox control?

    All of this controls are on the same form.

  2. #2
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,272

    Re: how to place the image of an object in the form?

    What code do you have so far?
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2013
    Posts
    148

    Re: how to place the image of an object in the form?

    actually I have this ocx control that captures image from webcam but it is not a picturebox control so its hard for me to save the image to file or to db. i have other codes to capture image from webcam to picturebox but then after its first use, i can no longer detect the webcam device. but this ocx has no problem.

    so it came to my idea if there is a way to capture that ocx control to picturebox.
    Last edited by ravemaster; Feb 3rd, 2013 at 11:27 PM.

  4. #4
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,272

    Re: how to place the image of an object in the form?

    Have you seen dilettante's code in the codebank? Maybe you don't need that OCX after all?

    http://www.vbforums.com/showthread.p...m-Minimal-Code
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jan 2013
    Posts
    148

    Re: how to place the image of an object in the form?

    yes I have checked it but i only give me black picturebox, no image at all, only black. that is why I wonder why that ocx is having no problem except that it has no save to file or to db capability.

    attach is the screenshot of the result
    Attached Images Attached Images  

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jan 2013
    Posts
    148

    Re: how to place the image of an object in the form?

    everytime I run the program, it will run properly and the camera device is detected but when I close the program and reopen it again, it , is as if it dont detect the device anymore. with this problem, I need to uninstall the device and reinstall the device again before the program can detect the device again. this is always the instance.

  7. #7
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: how to place the image of an object in the form?

    Quote Originally Posted by ravemaster View Post
    yes I have checked it but i only give me black picturebox, no image at all, only black.
    I have to assume that the DrirectShow filter graph I am using doesn't work for your camera. Since you have the source you could try a different filter graph, but I assume you haven't gone over my code alongside the DirectShow for VB documentation (in your MSDN Library CDs).

    Perhaps if I knew what camera you have it might help me figure out what to tweak in the filter graph. I only have two webcams to test with riht now and at least i have both working. I'd like to figure out a more universal set of filters that work for more cameras though.


    The other thing might be the capture configuration for the camera. The defaults can be undesireable.

    The newest demos (5a, 5b) I've posted give you a chance to set the capture properties on cam-start (though it doesn't save/load settings yet). Of course to use it you will have to download and install a 3rd party DLL.
    Last edited by dilettante; Feb 2nd, 2013 at 09:12 AM.

  8. #8
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: how to place the image of an object in the form?

    There is a "5c" demo there now, with a filter graph change that might help.

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Jan 2013
    Posts
    148

    Re: how to place the image of an object in the form?

    its a built-in webcam of acer aspireone 522 which is 1.3M Webcam

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Jan 2013
    Posts
    148

    Re: how to place the image of an object in the form?

    dilettante I tried the 5c demo but still same black screen with a little almost 1 milimeter by 1 milimeter size on the upper left corner of the box only showing that the cam is working coz you see the image from the cam.

  11. #11
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: how to place the image of an object in the form?

    Weird. Hard to imagine how, that's DirectShow's preview window set to scale itself to the requested dimensions. It must be scaling or that part of the Form would be the ButtonFace color, not black.

    Is there something strange about this camera?

  12. #12
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: how to place the image of an object in the form?

    Quote Originally Posted by ravemaster View Post
    I have this picturebox cotrol and this another control lets say button2.

    I would like to click on button1 and capture the image of button2 and place that on the picturebox control?

    All of this controls are on the same form.
    Maybe this is what you need
    Attached Files Attached Files


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Jan 2013
    Posts
    148

    Re: how to place the image of an object in the form?

    Quote Originally Posted by jmsrickland View Post
    Maybe this is what you need
    Sir, I cant thank you enough for this. And to all, thanks for your assisting me.

  14. #14
    New Member
    Join Date
    Oct 2013
    Posts
    2

    Re: how to place the image of an object in the form?

    Quote Originally Posted by jmsrickland View Post
    Maybe this is what you need
    how to open this sir? i cant add it to my project.

  15. #15
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: [RESOLVED] how to place the image of an object in the form?

    What do you mean how to open it? It's a zip file. You have to have an app that opens zip files, WinZip. for example


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width