Results 1 to 4 of 4

Thread: Questions about Obtaining images using DC Handle...

  1. #1

    Thread Starter
    Fanatic Member jian2587's Avatar
    Join Date
    Aug 2000
    Location
    I bet u need a fusion powered shuttle to reach my place...
    Posts
    963

    Questions about Obtaining images using DC Handle...

    When I get a DC handle of a window, say a button, I can obtain its image.
    But when the button is obstructed by another window, say probably a form,
    I'll get the partial form's image along with the button, too!
    Which means to say, it's WYIWYG.
    I want to get ONLY the image of the button, even when it's obstructed by
    other objects.

    Is there any solution here?

    Thank you.
    ASM,C,C++,BASIC,VB,JAVA,VBS,HTML,ASP,PHP,mySQL,VB.NET,MATLAB
    Programming is fun, but only if you're not on a tight deadline
    So I consider all those working engineers sad people

    VB FTP class
    3 page PHP crash course
    Crash Course on DX9 Managed with VB.NET covering basics till terrain creation

  2. #2

    Thread Starter
    Fanatic Member jian2587's Avatar
    Join Date
    Aug 2000
    Location
    I bet u need a fusion powered shuttle to reach my place...
    Posts
    963

    Re: Questions about Obtaining images using DC Handle...

    Hello anyone out there
    ASM,C,C++,BASIC,VB,JAVA,VBS,HTML,ASP,PHP,mySQL,VB.NET,MATLAB
    Programming is fun, but only if you're not on a tight deadline
    So I consider all those working engineers sad people

    VB FTP class
    3 page PHP crash course
    Crash Course on DX9 Managed with VB.NET covering basics till terrain creation

  3. #3
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: Questions about Obtaining images using DC Handle...

    Quote Originally Posted by jian2587
    Hello anyone out there
    Yeah, a lot of us. But I don't know what code you use to do it now, so it would be good if you can post the code.

  4. #4

    Thread Starter
    Fanatic Member jian2587's Avatar
    Join Date
    Aug 2000
    Location
    I bet u need a fusion powered shuttle to reach my place...
    Posts
    963

    Re: Questions about Obtaining images using DC Handle...

    It'll be something like this:
    VB Code:
    1. Dim butDC As Long, picDC As Long
    2. butDC = GetWindowDC(Command1.hWnd)
    3. picDC = GetWindowDC(Picture1.hWnd)
    4. StretchBlt picDC, 0, 0, 320, 240, butDC, 0, 0, _
    5. Command1.Width / Screen.TwipsPerPixelX, _
    6. Command1.Height / Screen.TwipsPerPixelY, _
    7. vbSrcCopy
    Okay, nothing fancy here, so I didn't post my codes.
    So Picture1 will get a picture of the button.
    But when you drag a window and obstruct the button partially, the picture box will
    have both the button and that window's image too.

    What I want to do:
    Regardless of the button being obstructed by another object, I want ONLY the picture
    of the button, and in COMPLETE form, without any obstructions.

    Anyone has done this before and are willing to share codes here?

    Thank you.
    ASM,C,C++,BASIC,VB,JAVA,VBS,HTML,ASP,PHP,mySQL,VB.NET,MATLAB
    Programming is fun, but only if you're not on a tight deadline
    So I consider all those working engineers sad people

    VB FTP class
    3 page PHP crash course
    Crash Course on DX9 Managed with VB.NET covering basics till terrain creation

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