A copy of the clipboard on the DC window.

A copy of the clipboard on the DC window.

Postby Natter » Tue May 28, 2024 9:01 am

Using scissors, I cut out a rectangular fragment of the screen and put it on the clipboard.
How can I put an image from the clipboard on the DC of my window ?
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: A copy of the clipboard on the DC window.

Postby nageswaragunupudi » Tue May 28, 2024 11:49 am

Image

Code: Select all  Expand view
#include "fivewin.ch"

function Main()

   XImage()

return nil
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: A copy of the clipboard on the DC window.

Postby Natter » Tue May 28, 2024 12:22 pm

Thanks !
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: A copy of the clipboard on the DC window.

Postby Natter » Fri May 31, 2024 8:36 am

Is it possible to estimate the size of the fragment in the clipboard ?
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: A copy of the clipboard on the DC window.

Postby nageswaragunupudi » Fri May 31, 2024 12:05 pm

Code: Select all  Expand view
aImage := FW_ReadImage()  // no params
? aImage[ 3 ], aImage[ 4 ]  // width and height in pixels

If there is no image in the clipboard, these values would be 0,0
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: A copy of the clipboard on the DC window.

Postby Natter » Fri May 31, 2024 12:14 pm

Did I understand correctly that FW_ReadImage (without parameters) accesses the clipboard ?
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: A copy of the clipboard on the DC window.

Postby nageswaragunupudi » Fri May 31, 2024 2:30 pm

Natter wrote:Did I understand correctly that FW_ReadImage (without parameters) accesses the clipboard ?

Yes, but if you are using the recent versions. ( FWH2310 and later)
What is the version you are using?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: A copy of the clipboard on the DC window.

Postby MMK » Thu Jun 06, 2024 2:36 pm

nageswaragunupudi wrote:
Natter wrote:Did I understand correctly that FW_ReadImage (without parameters) accesses the clipboard ?

Yes, but if you are using the recent versions. ( FWH2310 and later)
What is the version you are using?


And if version 2306?

Thank you!
MMK
 
Posts: 13
Joined: Thu Jan 22, 2009 6:24 am

Re: A copy of the clipboard on the DC window.

Postby nageswaragunupudi » Thu Jun 06, 2024 3:02 pm

Code: Select all  Expand view
hBitmap := FW_GetClipBoardData( 2 )
if hBitmap != nil
  // do whatever you want with hBitmap
endif
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 54 guests