-
How to take a picture from the back of the form while the form is being displayed to?
i found some codes about how can take screen shot of form or desktop and esc, now how to take a picture from the back of the form while the form is being displayed to the user? if i want to hide or minimize or change location of the form, the user will see a flashing form. Is it possible to do this without any delay in the user's view?
i dont want use aero glass windows because sometimes it disbaled by user or i want to make some different effect and add some objects and etc,I tried to make an example (i applied blur effect too) but its not good
-
Re: How to take a picture from the back of the form while the form is being displayed
Quote:
Originally Posted by
Black_Storm
if i want to hide or minimize or change location of the form, the user will see a flashing form[/CENTER]
In the past it was used LockWindowUpdate to hide those artifacts. Not sure if it still works.
-
Re: How to take a picture from the back of the form while the form is being displayed
-
Re: How to take a picture from the back of the form while the form is being displayed
Quote:
Originally Posted by
The trick
When I move the form or move the forms under the program, the image inside the form remains fixed, it seems that it needs a timer to work properly, because CallWindowProc is used and there are controls in the program. It has been used that they also use CallWindowProc, may be slow speed or a problem in execution?
-
Re: How to take a picture from the back of the form while the form is being displayed
Quote:
Originally Posted by
Eduardo-
In the past it was usedLockWindowUpdate to hide those artifacts. Not sure if it still works.
how can use in about this thread? i cant find any sample about how can take screen shot of behind form without flicker
-
Re: How to take a picture from the back of the form while the form is being displayed
Quote:
Originally Posted by
Black_Storm
how can use in about this thread? i cant find any sample about how can take screen shot of behind form without flicker
Take the shot before showing the form.
But regarding LockWindowUpdate, I'm not sure if it would work for that (I'm not sure if it is currently working at all BTW).
-
Re: How to take a picture from the back of the form while the form is being displayed
Taking a photo of the form before it is seen, especially when a standard form is not used and all the content is displayed on a layered canvas on the desktop, was a question that I followed here before:
[RESOLVED] How can take screen shot of special area outside of desktop?
I used the same method in post 1, of course, I had to do the same thing for the time when the user moves the form, but the blinking problem occurs.
Assuming, for example, that a photo is taken before the (layered canvas as a form is displayed), but after the form is displayed, the user can move the form, or that regardless of the form, changes may be happening under the form at any moment (like appearing new windows or changes that are constantly being made under the form on the desktop and windows under the form) so the form must always be taking a photo (except for the photo of our desired form) so there is always a need for a timer .
The problem is how to hide the form, take a picture, record the new changes of the windows and all the content of the bottom of the form, and then display the form again without creating a flashing state for the user. I am looking for an example project to do such a thing.
-
Re: How to take a picture from the back of the form while the form is being displayed
Why do you need to take this screenshot, anyway?
-
Re: How to take a picture from the back of the form while the form is being displayed
i doing design my custom skin form with controls and etc,It is my opinion that photography should always be taken
Reason: to get the changes that are always happening under the form window of the program
I want to design a part of my form, for example, the title part of the form, it can be any other part of my form in a way that looks like the glass mode of Windows, for example, blurred or apply other effects, and it is very important for me to be able to see the back of the form ( my means of back of the form is all windows under my form on dekstop and etc). and if a change happens behind the form window, it can be seen instantly
-
Re: How to take a picture from the back of the form while the form is being displayed
Perhaps you'll have to find what windows are behind the form, take a screenshot of each one and compose them into a single image.
-
Re: How to take a picture from the back of the form while the form is being displayed
I had this idea in mind before asking my question, but there is no guarantee that it will work well because there can be different states under the form that are complicated, there may be animations or content that simply cannot be captured,
Maybe in the same way that I am doing in the first post, there is a way that can solve this problem with a faster formula or with the help of some functions without the problem of blinking or faster processing.
if i wanna activate timer in my post 1 there is need again to take shot from behind form and again same flicker problem over and over.
Considering that you have worked in the field of graphics, maybe you can do a test or exercise or find an example that is useful.
-
Re: How to take a picture from the back of the form while the form is being displayed
Why not just to use what Windows already offers about transparency? Just saying.
-
Re: How to take a picture from the back of the form while the form is being displayed
any solution that can have the output I want is appreciated, but I need a testable example, if you can use it (whatever purpose of transparency you have in mind) to design the output I want, a test do it, in addition, it is also important that other objects can be placed on the blurred part, which may only display the objects on the desired part incorrectly, for example, I have a label for the title part on I have put the blurred image in post 1 to you can see it "title" caption. It is also important that I used blurring as an example effect and it can include more effects because I am designing the blurring effect with gdiplus, so it can be other effects. can also be replaced with similar animated effects or other modes
-
Re: How to take a picture from the back of the form while the form is being displayed
The example in this thread works for me both in IDE and compiled:
https://www.vbforums.com/showthread....ible-controls)
-
Re: How to take a picture from the back of the form while the form is being displayed
How can this sample help with the output I need? I mean, where can it be used?
-
Re: How to take a picture from the back of the form while the form is being displayed
You want your background to be transparent, don't you?
-
1 Attachment(s)
Re: How to take a picture from the back of the form while the form is being displayed
If what you mean by "transparent" is to make only a part of the form transparent so that that part is not visible and instead all the content below the form is displayed, then how can the content below the part that is transparent be affected, similar to the effect of blurring? Others, transparing can only remove the desired part, but it seems to me something like a photo of all the content under the form or a part of the form.
i want can watch all window behind of my form as a image and then i apply some effects like as blue or other effects.
let me explain again simple :
If I want to give an example, design a form and make it look like Windows Glass, so that the user can move it on the desktop and the content behind it can be seen as blurred or glass-like, the user may move the windows under the form. or open a new window and similar to these and the form can display them instantly
make something like as this forms :
and etc ...
i found some apis like as SetWindowDisplayAffinity and WDA_EXCLUDEFROMCAPTURE parameter :
SetWindowDisplayAffinity function (winuser.h) - Win32 apps | Microsoft Learn
i could not find any sample in vb6 about this and i guess its not support in all windows,if it can be work on win 7 or newer its okay but i guess its work on win 10 or maybe win 8
-
Re: How to take a picture from the back of the form while the form is being displayed
So, let's be clear: you want to show a form with some parts translucent (not totally transparent) but that the "light" that goes through it gets fuzzy, similar to a bathroom glass (to put an example).
But... and here is the most difficult part, you want to it to be totally dynamic. If the figures that are behind move or change, that needs to be updated. If the user is moving your translucent form, the fuzzy background needs to be updated in real time, as the form is moved.
In other words: the same or very similar to Windows Aero.
If I'm understanding that correctly, then, I don't think that such a real time update could be done by "taking pictures" of the windows that are behind.
Do you know of any program that does that? (besides Windows Aero that does it for the title bar)
I would start studying the Desktop Window Manager. Maybe someone with experience with it can tell you, but I didn't see much about it here.
Because that should be handled at low level to be really dynamic. From high level is already difficult to take e single picture without flicker.
-
Re: How to take a picture from the back of the form while the form is being displayed
-
Re: How to take a picture from the back of the form while the form is being displayed
i know about DwmEnableBlurBehindWindow ,i have too much samples about it but as i said in post 1 (my means of aero glass windows was been same use DwmEnableBlurBehindWindow):
Quote:
i dont want use aero glass windows because sometimes it disbaled by user or i want to make some different effect and add some objects and etc,I tried to make an example (i applied blur effect too) but its not good
If I want to use DwmEnableBlurBehindWindow, on the condition that if I only want to use Windows Glass only and support the service in Windows or the Glass theme in that Windows, which of course can have a series of other problems. And I don't want to be this way :
Code:
Public Sub GlassifyForm(frm As Form)
Dim aEn As MARGIN_STRUCT
aEn.cxLeftWidth = -1
aEn.cxRightWidth = -1
aEn.cyTopHeight = -1
aEn.cyBottomHeight = -1
DwmIsCompositionEnabled 1
DwmExtendFrameIntoClientArea frm.hWnd, aEn
End Sub
Private Sub Command1_Click()
GlassifyForm Me
End Sub
Private Sub Command2_Click()
Dim hr As Long
Me.BackColor = RGB(100, 0, 0)
Me.Refresh
DoEvents
hr = CreateEllipticRgn(0, 0, Width, Height)
Dim dbb As DwmBlurbehind
With dbb
.FEnable = True
.DwFlags = 1
.HRgnBlur = hr
.FTransitionOnMaximized = False
End With
DwmEnableBlurBehindWindow hWnd, dbb
End Sub
about
Quote:
Originally Posted by
Eduardo-
Do you know of any program that does that? (besides Windows Aero that does it for the title bar)
i seen some apps in delphis special skins in delphi , in vb or other languages i seen some examples about magnifer to can work on pixels under main form and real time live like as sbutton in vb and :
or some widgets and i guess it's like as these (maybe it's from your products) post 4(another magnifier version):
[VB6] - Desktop lens.-VBForums
i guess we need windowproc or maybe we need use SetWindowDisplayAffinity and WDA_EXCLUDEFROMCAPTURE (post 17) or any other way
-
Re: How to take a picture from the back of the form while the form is being displayed
Well, then you seem to be in the (probable) right direction.
You need to experiment with that API then.
Code:
Private Declare Function SetWindowDisplayAffinity Lib "user32" (ByVal hWnd As Long, ByVal dwAffinity As Long) As Long
Private Const WDA_EXCLUDEFROMCAPTURE As Long = &H11&
-
Re: How to take a picture from the back of the form while the form is being displayed
if you could work with some apis or some tricks about this thread maybe you can help me (since you work on graphics and have experience with graphics in vb, you can definitely test solutions that may work.) , maybe can make a simple test about it, about that apis (in post 17) maybe these apis just work on special windows version for example just can work on windows 10(i am not sure,i just read in some websites about these apis work on special versions of windows,maybe its not work on win 7),i could not find any samples in vb about use these apis ,i am on windows 8 now. maybe you can check in higher windows if you use.
-
Re: How to take a picture from the back of the form while the form is being displayed
Have you thought about just making a "child" form that is set to being "transparent"? If they have AERO being used, then use that... If NOT, then you fight with your custom roll-out version of transparency. (Also keeping in mind that some people ALSO have "transparency effects" disabled too.)
If AERO and "transparency effects" are disabled for forms... Then you need a third option for displaying a capture area. A simple "preview window", which the user sets the "area", with a custom sizable form, is fine. You can make custom masked forms which have "holes" in them, so they are just a border. (That gives them the ability to move and resize it, if you leave a chunk in the center with something that can register a mouse-down, and mouse-move event, like a picturebox or just the raw form.)
I disable form transparency, because, honestly, it is a waste of processing power in the OS. There is no need to see through a form, 99.99% of the time. Can't even think of a time when I wanted to "see through a form", which just makes that program harder to see. It was as dumb as windows making animations for opening and closing windows. Purely a novelty of, "We did it, because we could", not because anyone needed it. (Once they hijacked DX for the OS itself, to replace most of the GDI stuff, all this nonsense began.)
Yes, I get that this is that 0.01% situation where it might be useful, but there are other viable alternatives. Don't go crazy looking for an impossible solution, to which there is none.
The best possible, potential, solution... Would be to monitor EVERY displayed window, and track the windows positions, or try to hook some kind of callback to each window, to "know" when they have changed position or size. (Might seem virus-like doing the later.) Then, only once, you update the "blurred image", by hiding your program, getting a snapshot of that RECT where your program was, then use that as the new "blurry image". It's just one flicker, instead of many.
When you want your program to do complex stuff, you have to program complex solutions. All the simple stuff has already been done and those things have simple solutions. (Like using AERO features, for those who use it.)
Don't rule-out the simple, obvious, solution of a second child-form. Either as an attached body to the parent, moving with the form, or as a tiny "thumbnail" preview that can be moved out of the way or hidden, when it isn't needed. Think of Win-Amp, and the custom form shapes and "attached" child-forms to a parent.
-
Re: How to take a picture from the back of the form while the form is being displayed
Quote:
Originally Posted by
Black_Storm
maybe these apis just work on special windows version for example just can work on windows 10(i am not sure,i just read in some websites about these apis work on special versions of windows
You can read under Requirements:
Quote:
Minimum supported client: Windows 7 [desktop apps only]
-
Re: How to take a picture from the back of the form while the form is being displayed
i read these before too :
what that means i did try for use google translator but not translated good ,maybe its make problem on win 7 or win 8 or its depened on some services should be run ?
GetWindowDisplayAffinity function (winuser.h) - Win32 apps | Microsoft Learn
Quote:
This function and SetWindowDisplayAffinity are designed to support the window content protection feature unique to Windows 7. This feature enables applications to protect their own onscreen window content from being captured or copied via a specific set of public operating system features and APIs. However, it works only when the Desktop Window Manager (DWM) is composing the desktop.
It is important to note that unlike a security feature or an implementation of Digital Rights Management (DRM), there is no guarantee that using SetWindowDisplayAffinity and GetWindowDisplayAffinity, and other necessary functions such as DwmIsCompositionEnabled, will strictly protect windowed content, as in the case where someone takes a photograph of the screen.
SetWindowDisplayAffinity function (winuser.h) - Win32 apps | Microsoft Learn
Quote:
Starting in Windows 10 Version 2004, WDA_EXCLUDEFROMCAPTURE is a supported value. Setting the display affinity to WDA_EXCLUDEFROMCAPTURE on previous version of Windows will behave as if WDA_MONITOR is applied.
-
Re: How to take a picture from the back of the form while the form is being displayed
In Windows 10+ you should not have any of these troubles, since DWM should be always running.
Unfortunately these kind of things are not supported or too difficult to make them work on Windows 95/98/ME/NT4/2000/XP/7
-
Re: How to take a picture from the back of the form while the form is being displayed
Hello, I have tried many ways to do what you are looking for, but unfortunately from Windows 8 onwards it is no longer so easy or at least I still can't find the way, as you will see the example you are using of the magnifying glass works well in Windows 7 but not with later versions this is because it is no longer possible to capture behind ws_ex_layered windows
however I haven't tried the SetWindowDisplayAffinity api when I have a while I'll see if this can help, it looks good.
-
Re: How to take a picture from the back of the form while the form is being displayed
using the API
https://learn.microsoft.com/en-us/wi...er-printwindow
u can capture all windows, and after that its all about copy/cut around your window.
-
Re: How to take a picture from the back of the form while the form is being displayed
Quote:
Originally Posted by
LeandroA
Hello, I have tried many ways to do what you are looking for, but unfortunately from Windows 8 onwards it is no longer so easy or at least I still can't find the way, as you will see the example you are using of the magnifying glass works well in Windows 7 but not with later versions this is because it is no longer possible to capture behind ws_ex_layered windows
however I haven't tried the SetWindowDisplayAffinity api when I have a while I'll see if this can help, it looks good.
if you can test for something about this thread on windows 8 too maybe it can be help.
yes we can try more,maybe we can find good result.
I tried the following method a few days ago, it shows the window in black in the captured image, I guessed that maybe the window is not in the image at all, but this function seems to only be black
Code:
' REF : https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowdisplayaffinity
Private Declare Function SetWindowDisplayAffinity Lib "user32" (ByVal hWnd As Long, ByVal dwAffinity As Long) As Long
Private Declare Function GetWindowDisplayAffinity Lib "user32" (ByVal hWnd As Long, dwAffinity As Long) As Long
'Imposes no restrictions on where the window can be displayed.
WDA_NONE
'The window content is displayed only on a monitor. Everywhere else, the window appears with no content.
WDA_MONITOR
'he window is displayed only on a monitor. Everywhere else, the window does not appear at all.
'One use for this affinity is for windows that show video recording controls, so that the controls are not included in the capture.
'Introduced in Windows 10 Version 2004. See remarks about compatibility regarding previous versions of Windows.
WDA_EXCLUDEFROMCAPTURE
Private Const WDA_NONE As Long = &H0&
Private Const WDA_EXCLUDEFROMCAPTURE As Long = &H11&
Private Const WDA_MONITOR As Long = &H1&
Private Sub Command5_Click()
SetWindowDisplayAffinity hWnd, WDA_EXCLUDEFROMCAPTURE
Dim c As Long
MsgBox GetWindowDisplayAffinity(hWnd, c)
MsgBox c
SetWindowDisplayAffinity hWnd, WDA_NONE
MsgBox GetWindowDisplayAffinity(hWnd, c)
MsgBox c
End Sub
result is like as :
c# - How to use SetWindowDisplayAffinity - Stack Overflow
https://www.vbforums.com/images/ieimages/2023/01/5.png
this itself creates another problem when there are forms behind our program and it cannot get their content if we want to use this function in the case that we want to take a picture of the whole page with the help of this function.
-
Re: How to take a picture from the back of the form while the form is being displayed
Quote:
Originally Posted by
baka
did u see this :
https://www.vbforums.com/showthread....ide-of-desktop
its about using printwindow to i solved some problems(i had to move my window (layered canvas not like as standard form vb) outside of desktop to i can take image from it and used printwindow for solve) but it have some problem for use about this thread here.
if you know you can do make something with using printwindow and about this thread you can try for test.if you find good result you can show here.
I had used the same method temporarily in post number 1 from the beginning, but the form is blinking and its need live render. Meanwhile, read the description of the posts. The problem now is more than this, when the form is on the page and the user can move the windows under the program or A change is made under the form of the program that must be rendered in the program at the same moment, the problem in your explanation is that if there are windows below the window, they will be destroyed by cutting the lower windows.
In my opinion, for now, the only ways are either to process all the activities with the help of windowproc, or all the windows should be drawn on one DC, that is, the content of each window should be obtained separately, and all the drawings except the my window It is desirable to draw a DC, which is not an easy task and has some problems.
-
Re: How to take a picture from the back of the form while the form is being displayed
if the backgrounds are animated, it will be harder to achieve.
but if u instead ignore that u can just create a memory dc of the background.
this u do when your form gets focus. u just need to hide your form when u are doing a screenshot of the desktop.
so u are not continuously taking a screenshot, just when your form is getting focus.
another solution.
u use a transparent color where u want to show that blurry background.
now u will always see the background. now, using another form, u cover that part that will create that blurry picture of the background. at least its just a small area that u do that not the entire form.
-
Re: How to take a picture from the back of the form while the form is being displayed
Code:
Private Declare Function GetWindowDisplayAffinity Lib "user32" (ByVal hWnd As Long, ByRef dwAffinity As Long) As Long
[...]
If GetWindowDisplayAffinity(hWnd, c) then MsgBox c
-
Re: How to take a picture from the back of the form while the form is being displayed
Quote:
Originally Posted by
Eduardo-
Code:
Private Declare Function GetWindowDisplayAffinity Lib "user32" (ByVal hWnd As Long, ByRef dwAffinity As Long) As Long
[...]
If GetWindowDisplayAffinity(hWnd, c) then MsgBox c
I had forgotten to put the function in the modified form in the old code, I had used the following form in the project, which was not a problem.
Code:
Private Declare Function GetWindowDisplayAffinity Lib "user32" (ByVal hWnd As Long, dwAffinity As Long) As Long
seems these apis cant help about this thread,i am not sure yet.
-
Re: How to take a picture from the back of the form while the form is being displayed
ByRef and omitting it are the same since ByRef is the default.
-
Re: How to take a picture from the back of the form while the form is being displayed
yes i know, i guess i just to be focus on draw all windows on one dc without my wanted window but i guess still its hard special when my window is layered canvas too.
-
Re: How to take a picture from the back of the form while the form is being displayed
I wouldn't do that.
I would just take a screenshot of the desktop, hiding the form, its just milliseconds.
after that I use the memoryDC to create the blurry picture.
also, the .gif/preview u show. it seems to use the lock/release version when u move around the form.
I dont like that method at all. but its up to u.
-
Re: How to take a picture from the back of the form while the form is being displayed
Quote:
Originally Posted by
baka
if the backgrounds are animated, it will be harder to achieve.
but if u instead ignore that u can just create a memory dc of the background.
this u do when your form gets focus. u just need to hide your form when u are doing a screenshot of the desktop.
so u are not continuously taking a screenshot, just when your form is getting focus.
another solution.
u use a transparent color where u want to show that blurry background.
now u will always see the background. now, using another form, u cover that part that will create that blurry picture of the background. at least its just a small area that u do that not the entire form.
read post 1 and 18,its need render alive to can keep all changes alive in behind form and hide form is not good idea as i used in post 1 , u can see result in post 1 about flicker problem when user wanna move form or some changes maybe available beind window (animation is not only means ,means like as more than this like as all windows behind window can change position or another changes in live time.
see this link about a simple problem to will be happen too in my post 2 in this link and will be happen here about this thread too :
[VB6] - Desktop lens.-VBForums
baka It can always seem simple to say in theory and present the solution, but when you want to design and then implement, you will see what problems will arise.
just make a test about your solutions when u had time.
-
Re: How to take a picture from the back of the form while the form is being displayed
if its real-time, why not just use a filter
create a semi-transparent form with a "blurry-filter".
1. a rectangle semi-transparent with a filter-picture
2. a form where u use solid-fully-transparent color.
I mean, all this copy/paste is just too much work.
-
Re: How to take a picture from the back of the form while the form is being displayed
Definitely that SetWindowDisplayAffinity does what I wanted, but the final result is not good, it is very far from DwmExtendFrameIntoClientArea or SetWindowCompositionAttribute, the problem of trying to keep what goes behind the form in real time has its cost and it does not refresh like the apis mentioned above.
I show this example, without applying a blur it only shows the back part of the form in real time (if your dpi is different from 100, you would have to factor and reduce the capture. StretchBlt)
Code:
Option Explicit
Private Declare Function GetDC Lib "user32.dll" (ByVal hwnd As Long) As Long
Private Declare Function BitBlt Lib "gdi32.dll" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function ReleaseDC Lib "user32.dll" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Private Declare Function GetClientRect Lib "user32.dll" (ByVal hwnd As Long, ByRef lpRect As RECT) As Long
Private Declare Function ClientToScreen Lib "user32.dll" (ByVal hwnd As Long, ByRef lpPoint As POINTAPI) As Long
'Private Declare Function StretchBlt Lib "gdi32.dll" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
'Private Declare Function SetStretchBltMode Lib "gdi32.dll" (ByVal hdc As Long, ByVal nStretchMode As Long) As Long
Private Declare Function SetWindowDisplayAffinity Lib "user32" (ByVal hwnd As Long, ByVal dwAffinity As Long) As Long
Private Const WDA_EXCLUDEFROMCAPTURE As Long = &H11&
Private Type POINTAPI
x As Long
y As Long
End Type
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Sub Form_Load()
SetWindowDisplayAffinity hwnd, WDA_EXCLUDEFROMCAPTURE
Me.AutoRedraw = True
Timer1.Interval = 1
End Sub
Private Sub Timer1_Timer()
Dim R As RECT, DC As Long, PT As POINTAPI
GetClientRect hwnd, R
ClientToScreen hwnd, PT
DC = GetDC(0)
BitBlt hdc, 0, 0, R.Right - R.Left, R.Bottom - R.Top, DC, PT.x, PT.y, vbSrcCopy
ReleaseDC 0, DC
Me.Refresh
End Sub
-
Re: How to take a picture from the back of the form while the form is being displayed
timer is not reliable. it need to be subclassed or using a loop.
-
Re: How to take a picture from the back of the form while the form is being displayed
u know. u could actually create 2 executable.
1 is the "transparent" rectangle.
and 1 is the form itself.
using sendmessage u can communicate with each other.
so, the transparent form, will just do the blur-copying and nothing else.
and since its just a small area it should be fast.
subclassing it and it will follow the main-form smoothly.
u will create a dual-thread-program this way.
I already do that with my game, 1 external program for screenshot, music loading/playback and wordchecker.
and the game is running smoother and without freezing when loading a new mp3.
-
Re: How to take a picture from the back of the form while the form is being displayed
Here I applied some blur in the center (I put a LabelPlus control that blurs the background) I had to capture it with my mobile phone because screen recorders can't record it.
https://youtu.be/GpGeRqt85s0
-
Re: How to take a picture from the back of the form while the form is being displayed
the problem with the delay could be fixed if we have a "sync" solution.
when paint-event we do it. the same with my game. I need to follow the monitor sync to make it smooth.
the VB.Timer will never work here.
-
1 Attachment(s)
Re: How to take a picture from the back of the form while the form is being displayed
I modified Leandro's code to update the capture in the WM_WINDOWPOSCHANGING message, it more or less works (at least on my PC).
Now what it is left is to implement the blur filter.
-
1 Attachment(s)
Re: How to take a picture from the back of the form while the form is being displayed
Here is a attempt with blurr, it more or less work, but it is far from perfect.
-
Re: How to take a picture from the back of the form while the form is being displayed
-
Re: How to take a picture from the back of the form while the form is being displayed
hi , about attachments in :
Quote:
Originally Posted by
Eduardo-
I modified Leandro's code to update the capture in the WM_WINDOWPOSCHANGING message, it more or less works (at least on my PC).
Now what it is left is to implement the blur filter.
and
Quote:
Originally Posted by
Eduardo-
Here is a attempt with blurr, it more or less work, but it is far from perfect.
i downloaded two attachments and result after test was been like as these on my windows 8 64 bit , i had to record of screen with phone to can send result here : ( work not good )
https://www.vbforums.com/images/ieimages/2023/01/10.jpg
animated gif:
-
Re: How to take a picture from the back of the form while the form is being displayed
Quote:
Originally Posted by
The trick
Code:
' //
' // modGlass.bas - apply glass effect
' // by The trick 2023
' //
Option Explicit
Private Enum PTR
NULL_PTR
End Enum
Private Const DIB_RGB_COLORS As Long = 0
Private Const GWL_EXSTYLE As Long = (-20)
Private Const WS_EX_LAYERED As Long = &H80000
Private Const FADF_AUTO As Long = 1
Private Const HTCAPTION As Long = 2
Private Const WM_NCHITTEST As Long = &H84
Private Const WM_PAINT As Long = &HF
Private Const WM_WINDOWPOSCHANGING As Long = &H46
Private Const WM_MOUSEWHEEL As Long = &H20A&
Private Const DC_PEN As Long = 19
Private Const NULL_BRUSH As Long = 5
Private Const ULW_OPAQUE As Long = 4
Private Type POINTAPI
lX As Long
lY As Long
End Type
Private Type SIZE
cx As Long
cy As Long
End Type
Private Type SAFEARRAYBOUND
cCount As Long
lBound As Long
End Type
Private Type SAFEARRAY1D
cDims As Integer
fFeatures As Integer
cbElements As Long
cLocks As Long
pvData As PTR
Bounds As SAFEARRAYBOUND
End Type
Private Type RECT
lLeft As Long
lTop As Long
lRight As Long
lBottom As Long
End Type
Private Type PAINTSTRUCT
hDC As OLE_HANDLE
fErase As Long
rcPaint As RECT
fRestore As Long
fIncUpdate As Long
rgbReserved(32) As Byte
End Type
Private Type WINDOWPOS
hwnd As OLE_HANDLE
hWndInsertAfter As OLE_HANDLE
x As Long
y As Long
cx As Long
cy As Long
flags As Long
End Type
Private Type RGBQUAD
rgbBlue As Byte
rgbGreen As Byte
rgbRed As Byte
rgbReserved As Byte
End Type
Private Type BITMAPINFOHEADER
biSize As Long
biWidth As Long
biHeight As Long
biPlanes As Integer
biBitCount As Integer
biCompression As Long
biSizeImage As Long
biXPelsPerMeter As Long
biYPelsPerMeter As Long
biClrUsed As Long
biClrImportant As Long
End Type
Private Type BITMAPINFO
bmiHeader As BITMAPINFOHEADER
bmiColors As RGBQUAD
End Type
Private Type GLASS_WINDOW_ENTRY
hwnd As OLE_HANDLE
lWidth As Long
lHeight As Long
hBitmap As OLE_HANDLE
hDC As OLE_HANDLE
bPixels() As Byte
lBlurLevel As Long
tSADesc As SAFEARRAY1D
End Type
Private Declare Sub PutMemPtr Lib "msvbvm60" _
Alias "PutMem4" ( _
ByRef pAddr As Any, _
ByVal pVal As PTR)
Private Declare Function ArrPtr Lib "msvbvm60" _
Alias "VarPtr" ( _
ByRef ppSA() As Any) As PTR
Private Declare Function SetWindowLongPtr Lib "user32" _
Alias "SetWindowLongW" ( _
ByVal hwnd As OLE_HANDLE, _
ByVal nIndex As Long, _
ByVal dwNewLong As PTR) As PTR
Private Declare Function GetWindowLongPtr Lib "user32" _
Alias "GetWindowLongW" ( _
ByVal hwnd As OLE_HANDLE, _
ByVal nIndex As Long) As PTR
Private Declare Function SetTimer Lib "user32" ( _
ByVal hwnd As OLE_HANDLE, _
ByVal nIDEvent As PTR, _
ByVal uElapse As Long, _
ByVal lpTimerFunc As PTR) As PTR
Private Declare Function GetWindowRect Lib "user32" ( _
ByVal hwnd As OLE_HANDLE, _
ByRef lpRect As RECT) As Long
Private Declare Function CreateDIBSection Lib "gdi32" ( _
ByVal hDC As OLE_HANDLE, _
ByRef pBitmapInfo As BITMAPINFO, _
ByVal dwUsage As Long, _
ByRef ppvBits As Any, _
ByVal hSection As OLE_HANDLE, _
ByVal dwOffset As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" ( _
ByVal hObject As OLE_HANDLE) As Long
Private Declare Function GetDC Lib "user32" ( _
ByVal hwnd As OLE_HANDLE) As Long
Private Declare Function ReleaseDC Lib "user32" ( _
ByVal hwnd As OLE_HANDLE, _
ByVal hDC As OLE_HANDLE) As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" ( _
ByVal hDC As OLE_HANDLE) As Long
Private Declare Function SelectObject Lib "gdi32" ( _
ByVal hDC As OLE_HANDLE, _
ByVal hObject As OLE_HANDLE) As OLE_HANDLE
Private Declare Function SaveDC Lib "gdi32" ( _
ByVal hDC As OLE_HANDLE) As Long
Private Declare Function RestoreDC Lib "gdi32" ( _
ByVal hDC As OLE_HANDLE, _
ByVal nSavedDC As Long) As Long
Private Declare Function DeleteDC Lib "gdi32" ( _
ByVal hDC As OLE_HANDLE) As Long
Private Declare Function InvalidateRect Lib "user32" ( _
ByVal hwnd As OLE_HANDLE, _
ByRef lpRect As Any, _
ByVal bErase As Long) As Long
Private Declare Function SetWindowSubclass Lib "Comctl32" ( _
ByVal hwnd As OLE_HANDLE, _
ByVal pfnSubclass As PTR, _
ByVal uIdSubclass As PTR, _
ByRef dwRefData As Any) As Long
Private Declare Function RemoveWindowSubclass Lib "Comctl32" ( _
ByVal hwnd As OLE_HANDLE, _
ByVal pfnSubclass As PTR, _
ByVal uIdSubclass As PTR) As Long
Private Declare Function DefSubclassProc Lib "Comctl32" ( _
ByVal hwnd As OLE_HANDLE, _
ByVal uMsg As Long, _
ByVal wParam As PTR, _
ByVal lParam As PTR) As PTR
Private Declare Function BeginPaint Lib "user32" ( _
ByVal hwnd As OLE_HANDLE, _
ByRef lpPaint As PAINTSTRUCT) As Long
Private Declare Function EndPaint Lib "user32" ( _
ByVal hwnd As OLE_HANDLE, _
ByRef lpPaint As PAINTSTRUCT) As Long
Private Declare Function GetStockObject Lib "gdi32" ( _
ByVal nIndex As Long) As OLE_HANDLE
Private Declare Function SetDCPenColor Lib "gdi32" ( _
ByVal hDC As OLE_HANDLE, _
ByVal colorref As Long) As Long
Private Declare Function RoundRect Lib "gdi32" ( _
ByVal hDC As OLE_HANDLE, _
ByVal X1 As Long, _
ByVal Y1 As Long, _
ByVal X2 As Long, _
ByVal Y2 As Long, _
ByVal X3 As Long, _
ByVal Y3 As Long) As Long
Private Declare Function BitBlt Lib "gdi32" ( _
ByVal hDestDC As OLE_HANDLE, _
ByVal x As Long, _
ByVal y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal hSrcDC As OLE_HANDLE, _
ByVal xSrc As Long, _
ByVal ySrc As Long, _
ByVal dwRop As Long) As Long
Private Declare Function KillTimer Lib "user32" ( _
ByVal hwnd As OLE_HANDLE, _
ByVal nIDEvent As PTR) As Long
Private Declare Function UpdateLayeredWindow Lib "user32" ( _
ByVal hwnd As OLE_HANDLE, _
ByVal hdcDst As Long, _
ByRef pptDst As Any, _
ByRef psize As SIZE, _
ByVal hdcSrc As OLE_HANDLE, _
ByRef pptSrc As POINTAPI, _
ByVal crKey As Long, _
ByRef pblend As Long, _
ByVal dwFlags As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" ( _
ByVal hwnd As OLE_HANDLE, _
ByVal hRgn As OLE_HANDLE, _
ByVal bRedraw As Boolean) As Long
Private Declare Function CreateRoundRectRgn Lib "gdi32" ( _
ByVal X1 As Long, _
ByVal Y1 As Long, _
ByVal X2 As Long, _
ByVal Y2 As Long, _
ByVal X3 As Long, _
ByVal Y3 As Long) As OLE_HANDLE
Private m_tWindows() As GLASS_WINDOW_ENTRY
Private m_lWindowsCount As Long
Private m_uTimerID As PTR
Public Function ApplyGlass( _
ByVal hwnd As OLE_HANDLE) As Boolean
Dim tRC As RECT
Dim tBI As BITMAPINFO
Dim lWidth As Long
Dim lHeight As Long
Dim hBitmap As OLE_HANDLE
Dim hDC As OLE_HANDLE
Dim hMemDC As OLE_HANDLE
Dim pBits As PTR
Dim bStyle As Boolean
Dim bRet As Boolean
Dim lIndex As Long
Dim bAdded As Boolean
Dim bHook As Boolean
Dim hRgn As OLE_HANDLE
Dim bRgnSet As Boolean
If GetWindowRect(hwnd, tRC) = 0 Then
Exit Function
End If
lWidth = tRC.lRight - tRC.lLeft
lHeight = tRC.lBottom - tRC.lTop
With tBI.bmiHeader
.biSize = LenB(tBI.bmiHeader)
.biBitCount = 32
.biHeight = -lHeight * 2
.biWidth = lWidth
.biPlanes = 1
End With
hDC = GetDC(hwnd)
If hDC = 0 Then
Exit Function
End If
hMemDC = CreateCompatibleDC(hDC)
If hMemDC = 0 Then
GoTo CleanUp
End If
hBitmap = CreateDIBSection(hDC, tBI, DIB_RGB_COLORS, pBits, NULL_PTR, 0)
If hBitmap = 0 Then
GoTo CleanUp
End If
If SaveDC(hMemDC) = 0 Then
GoTo CleanUp
End If
If SelectObject(hMemDC, hBitmap) = 0 Then
GoTo CleanUp
End If
If SelectObject(hMemDC, GetStockObject(DC_PEN)) = 0 Then
GoTo CleanUp
End If
If SelectObject(hMemDC, GetStockObject(NULL_BRUSH)) = 0 Then
GoTo CleanUp
End If
hRgn = CreateRoundRectRgn(0, 0, lWidth + 1, lHeight + 1, 17, 17)
If hRgn = NULL_PTR Then
GoTo CleanUp
End If
If SetWindowRgn(hwnd, hRgn, False) = 0 Then
GoTo CleanUp
End If
bRgnSet = True
SetDCPenColor hMemDC, &HE0E080
If SetWindowLongPtr(hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) Or WS_EX_LAYERED) = 0 Then
GoTo CleanUp
End If
bStyle = True
lIndex = AddWindowEntry(hwnd, hBitmap, pBits, hMemDC, lWidth, lHeight, 7)
bAdded = True
If SetWindowSubclass(hwnd, AddressOf GlassWndProc, NULL_PTR, ByVal lIndex) = 0 Then
GoTo CleanUp
End If
bHook = True
If m_uTimerID = NULL_PTR Then
m_uTimerID = SetTimer(NULL_PTR, NULL_PTR, 200, AddressOf TimerProc)
If m_uTimerID = NULL_PTR Then
GoTo CleanUp
End If
End If
bRet = True
CleanUp:
If Not bRet Then
If bHook Then
RemoveWindowSubclass hwnd, AddressOf GlassWndProc, NULL_PTR
End If
If bStyle Then
SetWindowLongPtr hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) And (Not WS_EX_LAYERED)
End If
If bAdded Then
RemoveWindowEntry hwnd
End If
If hMemDC Then
RestoreDC hMemDC, -1
DeleteDC hMemDC
End If
If hBitmap Then
DeleteObject hBitmap
End If
End If
If Not bRgnSet And hRgn <> 0 Then
DeleteObject hRgn
End If
If hDC Then
ReleaseDC hwnd, hDC
End If
End Function
Public Function DisableGlass( _
ByVal hwnd As OLE_HANDLE) As Boolean
DisableGlass = RemoveWindowEntry(hwnd)
End Function
Private Function AddWindowEntry( _
ByVal hwnd As OLE_HANDLE, _
ByVal hBitmap As OLE_HANDLE, _
ByVal pBits As PTR, _
ByVal hDC As OLE_HANDLE, _
ByVal lWidth As Long, _
ByVal lHeight As Long, _
ByVal lBlurLevel As Long) As Long
Dim lIndex As Long
For lIndex = 0 To m_lWindowsCount - 1
If m_tWindows(lIndex).hwnd = NULL_PTR Then
Exit For
End If
Next
If lIndex = m_lWindowsCount Then
If lIndex Then
If lIndex > UBound(m_tWindows) Then
ReDim Preserve m_tWindows(m_lWindowsCount + 10)
End If
Else
ReDim m_tWindows(9)
End If
End If
With m_tWindows(lIndex)
.hwnd = hwnd
.lBlurLevel = lBlurLevel
.hBitmap = hBitmap
.hDC = hDC
.lHeight = lHeight
.lWidth = lWidth
With .tSADesc
.Bounds.cCount = lWidth * lHeight * 2 * 4
.cbElements = 1
.cDims = 1
.fFeatures = FADF_AUTO
.pvData = pBits
End With
PutMemPtr ByVal ArrPtr(.bPixels), VarPtr(.tSADesc)
m_lWindowsCount = m_lWindowsCount + 1
End With
AddWindowEntry = lIndex
End Function
Private Function RemoveWindowEntry( _
ByVal hwnd As OLE_HANDLE) As Boolean
Dim lIndex As Long
For lIndex = 0 To m_lWindowsCount - 1
With m_tWindows(lIndex)
If .hwnd = hwnd Then
RemoveWindowSubclass hwnd, AddressOf GlassWndProc, NULL_PTR
PutMemPtr ByVal ArrPtr(.bPixels), NULL_PTR
RestoreDC .hDC, -1
DeleteObject .hBitmap
DeleteDC .hDC
SetWindowLongPtr hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) And (Not WS_EX_LAYERED)
.hwnd = NULL_PTR
m_lWindowsCount = m_lWindowsCount - 1
If m_lWindowsCount = 0 Then
KillTimer NULL_PTR, m_uTimerID
m_uTimerID = NULL_PTR
End If
RemoveWindowEntry = True
Exit For
End If
End With
Next
End Function
Private Function GlassWndProc( _
ByVal hwnd As OLE_HANDLE, _
ByVal lMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long, _
ByVal uId As PTR, _
ByVal dwRefData As PTR) As PTR
Select Case lMsg
Case WM_WINDOWPOSCHANGING
UpdateGlassWindow hwnd
Case WM_NCHITTEST
GlassWndProc = HTCAPTION
Case WM_MOUSEWHEEL
GlassWndProc = OnWheel(hwnd, wParam)
Case Else
GlassWndProc = DefSubclassProc(hwnd, lMsg, wParam, lParam)
End Select
End Function
Private Sub TimerProc( _
ByVal hwnd As OLE_HANDLE, _
ByVal uMsg As Long, _
ByVal idEvent As PTR, _
ByVal dwTime As Long)
Dim lIndex As Long
For lIndex = 0 To m_lWindowsCount - 1
If m_tWindows(lIndex).hwnd Then
UpdateGlass m_tWindows(lIndex)
End If
Next
End Sub
Private Function OnWheel( _
ByVal hwnd As OLE_HANDLE, _
ByVal lValue As Long) As PTR
Dim lIndex As Long
For lIndex = 0 To m_lWindowsCount - 1
With m_tWindows(lIndex)
If .hwnd = hwnd Then
.lBlurLevel = .lBlurLevel + Sgn(lValue)
If .lBlurLevel < 2 Then
.lBlurLevel = 2
ElseIf .lBlurLevel > 21 Then
.lBlurLevel = 21
End If
Exit For
End If
End With
Next
End Function
Private Sub UpdateGlassWindow( _
ByVal hwnd As OLE_HANDLE)
Dim lIndex As Long
For lIndex = 0 To m_lWindowsCount - 1
If m_tWindows(lIndex).hwnd = hwnd Then
UpdateGlass m_tWindows(lIndex)
Exit For
End If
Next
End Sub
Private Sub UpdateGlass( _
ByRef tEntry As GLASS_WINDOW_ENTRY)
Dim hDC As OLE_HANDLE
Dim tRC As RECT
Dim tPT As POINTAPI
Dim tSize As SIZE
hDC = GetDC(NULL_PTR)
If hDC = NULL_PTR Then
Exit Sub
End If
GetWindowRect tEntry.hwnd, tRC
BitBlt tEntry.hDC, 0, 0, tEntry.lWidth, tEntry.lHeight, hDC, tRC.lLeft, tRC.lTop, vbSrcCopy
ApplyBlur tEntry.bPixels, tEntry.lWidth, tEntry.lHeight, tEntry.lBlurLevel, &HFFE060
RoundRect tEntry.hDC, 0, 0, tEntry.lWidth, tEntry.lHeight, 16, 16
tSize.cx = tRC.lRight - tRC.lLeft
tSize.cy = tRC.lBottom - tRC.lTop
UpdateLayeredWindow tEntry.hwnd, NULL_PTR, ByVal NULL_PTR, tSize, tEntry.hDC, tPT, 0, 0, ULW_OPAQUE
CleanUp:
ReleaseDC NULL_PTR, hDC
End Sub
Private Sub ApplyBlur( _
ByRef bPix() As Byte, _
ByVal lWidth As Long, _
ByVal lHeight As Long, _
ByVal lSize As Long, _
Optional ByVal lRGBFactor As Long = &HFFFFFF)
Dim lX As Long: Dim lY As Long: Dim lS As Long
Dim lE As Long: Dim lZ As Long: Dim lR As Long
Dim lG As Long: Dim lB As Long: Dim lI As Long
Dim lD As Long: Dim lA As Long: Dim lQ As Long
Dim lK As Long: Dim lFR As Long: Dim lFG As Long
Dim lFB As Long
If lSize <= 1 Then
Exit Sub
End If
lFR = (lRGBFactor And &HFF0000) \ &H10000
lFG = (lRGBFactor And &HFF00&) \ &H100
lFB = (lRGBFactor And &HFF)
lS = lSize \ 2
lE = (lSize - 1) \ 2
lZ = lWidth - lE - 1
lQ = lHeight * lWidth * 4
lK = lWidth * 4
For lY = 0 To lHeight - 1
' // Calc for -1 pix
If lE Then
lR = bPix(lI)
lG = bPix(lI + 1)
lB = bPix(lI + 2)
Else
lR = 0
lG = 0
lB = 0
End If
lI = lI + 4
For lX = 0 To lS
If lX <= lE - 2 Then
lR = lR + bPix(lI) * 2&
lG = lG + bPix(lI + 1) * 2&
lB = lB + bPix(lI + 2) * 2&
Else
lR = lR + bPix(lI)
lG = lG + bPix(lI + 1)
lB = lB + bPix(lI + 2)
End If
lI = lI + 4
Next
lI = lI - (lS + 2) * 4
lA = lI + lE * 4
lD = lI + (lS + 1) * 4
For lX = 0 To lWidth - 1
lR = lR + bPix(lA) - bPix(lD)
lG = lG + bPix(lA + 1) - bPix(lD + 1)
lB = lB + bPix(lA + 2) - bPix(lD + 2)
bPix(lQ) = lR \ lSize
bPix(lQ + 1) = lG \ lSize
bPix(lQ + 2) = lB \ lSize
lQ = lQ + 4
If lX <= lS Then
lD = lD - 4
lA = lA + 4
ElseIf lX >= lZ Then
lA = lA - 4
lD = lD + 4
Else
lD = lD + 4
lA = lA + 4
End If
Next
lI = lI + lK
Next
lZ = lHeight - lE - 1
lQ = 0
For lX = 0 To lWidth - 1
' // Calc for -1 pix
If lE Then
lR = bPix(lI)
lG = bPix(lI + 1)
lB = bPix(lI + 2)
Else
lR = 0
lG = 0
lB = 0
End If
lI = lI + lK
For lY = 0 To lS
If lY <= lE - 2 Then
lR = lR + bPix(lI) * 2&
lG = lG + bPix(lI + 1) * 2&
lB = lB + bPix(lI + 2) * 2&
Else
lR = lR + bPix(lI)
lG = lG + bPix(lI + 1)
lB = lB + bPix(lI + 2)
End If
lI = lI + lK
Next
lI = lI - (lS + 2) * lK
lA = lI + lE * lK
lD = lI + (lS + 1) * lK
For lY = 0 To lHeight - 1
lR = lR + bPix(lA) - bPix(lD)
lG = lG + bPix(lA + 1) - bPix(lD + 1)
lB = lB + bPix(lA + 2) - bPix(lD + 2)
bPix(lQ) = ((lR \ lSize) * lFR) \ &H100
bPix(lQ + 1) = ((lG \ lSize) * lFG) \ &H100
bPix(lQ + 2) = ((lB \ lSize) * lFB) \ &H100
lQ = lQ + lK
If lY <= lS Then
lD = lD - lK
lA = lA + lK
ElseIf lY >= lZ Then
lA = lA - lK
lD = lD + lK
Else
lD = lD + lK
lA = lA + lK
End If
Next
lI = lI + 4
lQ = lQ + 4 - lK * lHeight
Next
End Sub
?!!!!!
what is this ?
-
Re: How to take a picture from the back of the form while the form is being displayed
i did try more and result like as this, i created this some days ago :
but not worked good again (not applied blurred effect bcs same old problems to we talked about it before).
-
Re: How to take a picture from the back of the form while the form is being displayed
Quote:
Originally Posted by
Black_Storm
It's for XP/Vista/7 with DWM disabled. For 8 and higher you could use Magnification API:
https://www.vbforums.com/images/ieimages/2023/01/15.gif
The proper way is to use DirectComposition but it's available since Win8.
-
Re: How to take a picture from the back of the form while the form is being displayed
how can fix flicker poblem about use this sample with magnifierapi.most times its work with delay display and its need run smoother :
Two points should be considered
- So two versions should be combined so that both the version under Windows 8 version and the version higher than 8 can be used?
- An important question about DirectComposition for win 8 (or higher than win8) I couldn't find an example of it in VB6 by searching, can you prepare an example, of course, it seems that there are examples in other languages, but I didn't find anything like that in VB6.
-
1 Attachment(s)
Re: How to take a picture from the back of the form while the form is being displayed
I've modified both examples they should work little bit smoother.
-
Re: How to take a picture from the back of the form while the form is being displayed
its better now , thanks , possible to combine both sources in one source to suppoer from xp till more than win 8 ?
about DirectComposition can prepare an example?
-
1 Attachment(s)
Re: How to take a picture from the back of the form while the form is being displayed
Quote:
Originally Posted by
Eduardo-
Here is a attempt with blurr, it more or less works, but it is far from perfect.
I forgot to update the background permanently (in what I've posted it just is updated when the forms is moved).
Here it is the project updated.
-
Re: How to take a picture from the back of the form while the form is being displayed
i can resolve this thread but maybe we can have another chance for work with DirectComposition in vb too so i had to create new thread about using DirectComposition in vb :
Thread: DirectComposition in vb?
i hope to can find a sample and maybe we can use the DirectComposition about this thread too.
-
Re: How to take a picture from the back of the form while the form is being displayed
If I want to hide or minimize or change the position of the form, the user will see a flashing form. Is it possible to do this without any delay in user view?
-
Re: How to take a picture from the back of the form while the form is being displayed
@Antonio, how is your question related to this topic?
-
Re: How to take a picture from the back of the form while the form is being displayed
I combined two different versions of the trick in one project to automatically call the corresponding functions after detecting the Windows version, so now it should be supported from Windows XP to Windows 10 and above, but now the problem is that if If I want to combine this project in other projects, it will be a bit more complicated. Of course, I also asked a question about this, which remained unanswered:
Here, for example, I have asked about whether we want to use several controls or classes, each of which can have its own windowprocs.
Thread: 2 forms moving together
Is it possible to make a version similar to a user control or a more compact version that makes it easier to use, for example, if we have a form and want to combine the controls on it with this project, or the like, if it can be in the form of a user control which can be set on the form.