Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 4 Jahren, 10 Monaten
Letzter Beitrag:
vor 4 Jahren, 10 Monaten
Beteiligte Autoren:
JP, Al

[WD18] - Copy the window image

Startbeitrag von JP am 08.09.2013 14:35

Hi All,

I am looking to copy the window image. I have found the function dCopyWindowImage() which does work fine. However, this copies the window image including borders and title bar. How can I copy only the inner contents of the window, without borders or title bar, to an image variable?



Re: Copy the window image

Hello JP

There was a much earlier example in V9 that I can't find now but it used dCopyBlt()
It may give you what you need.

IF GScrnCapBorder = True
//Include Borders
//exclude borders

// Save to the JPGP format
dEndDrawing(LImageDest) // Free the size taken in memory


von Al - am 08.09.2013 17:06
Hi Al,

Thanks for the suggestion. I'm using WD18 and it says that the dCopyBlt function is deprecated. When I try to use it, it fails to create the new image - it does not generate an error but also does not copy the source image even if I let the additional parameters be defaulted i.e. just make a coipy of the source image.

WD suggest using dCopy() but that also is not recognized in the editor. I try and use the French variation dCopie() which is recognized in the editor but again it does not copy the source image.

I aslo tried dCopyScreenImage() which works but you get the whole screen, obviously.

I tried dCopyWindowImage() and that works but you get the borders and title and I cant see how to remove them from the final image to save.

von JP - am 08.09.2013 18:13
Hi Al,

Thanks to you I found a solution using dCopyScreenImage() combined with the parameters you used in your example for x,y,width, and height coordinates of the window.

SourceImage is Image
SourceImage = dCopyScreenImage( WinInXPos(), WinInYPos(), WinInWidth() , WinInHeight() )

Thanks Al!

von JP - am 08.09.2013 18:19
Hello JP

It all comes around - you have now helped me solve a problem I would have had when I converted my older projects to V18


von Al - am 08.09.2013 18:40
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.