Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
5
Erster Beitrag:
vor 4 Jahren, 7 Monaten
Letzter Beitrag:
vor 4 Jahren, 7 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?

Thanks

Antworten:

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
dCopyBlt(copyScreen,LImageDest,copySrcCopy,WinOutXPos(),WinOutYPos(),WinOutHeight(),WinOutWidth())
ELSE
//exclude borders
dCopyBlt(copyScreen,LImageDest,copySrcCopy,WinInXPos(),WinInYPos(),WinInHeight()+2,WinInWidth()+2)
END

// Save to the JPGP format
dSaveImageJPEG(LImageDest,GScrnCapJPG,100)
dEndDrawing(LImageDest) // Free the size taken in memory





Regards
Al

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

Regards
Al

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.