|
-
May 21st, 2005, 11:49 PM
#1
Thread Starter
Fanatic Member
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
-
May 22nd, 2005, 09:10 PM
#2
Thread Starter
Fanatic Member
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
-
May 22nd, 2005, 09:16 PM
#3
Re: Questions about Obtaining images using DC Handle...
 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.
-
May 22nd, 2005, 10:27 PM
#4
Thread Starter
Fanatic Member
Re: Questions about Obtaining images using DC Handle...
It'll be something like this:
VB Code:
Dim butDC As Long, picDC As Long
butDC = GetWindowDC(Command1.hWnd)
picDC = GetWindowDC(Picture1.hWnd)
StretchBlt picDC, 0, 0, 320, 240, butDC, 0, 0, _
Command1.Width / Screen.TwipsPerPixelX, _
Command1.Height / Screen.TwipsPerPixelY, _
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|