copy an image from the Windows clipboard - SOLVED
Posted: Sat Nov 30, 2024 1:27 pm
Would it be possible, using a dialog with an image resource, to copy an image from the Windows clipboard?
www.FiveTechSoft.com
https://forums.fivetechsupport.com/
Code: Select all | Expand
#include "fivewin.ch"
//----------------------------------------------------------------------------//
function Main()
local aImages, oWnd, oFont, oBrush, oBrw, oImage
FW_SetUnicode( .t. )
HB_SETCODEPAGE( "UTF8" ) // Harbour (not xHarbour) to display unicode filenames
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-15
DEFINE WINDOW oWnd
oWnd:SetFont( oFont )
DEFINE BUTTONBAR oWnd:oBar SIZE 100,32 2007
SET MESSAGE OF oWnd TO "" 2007
DEFINE BUTTON OF oWnd:oBar PROMPT "Center" CENTER ACTION ( oImage:Center(), oImage:SetFocus() )
DEFINE BUTTON OF oWnd:oBar PROMPT "Fit Width" CENTER ACTION ( oImage:FitWidth(), oImage:SetFocus() )
DEFINE BUTTON OF oWnd:oBar PROMPT "Fit Height" CENTER ACTION ( oImage:FitHeight(), oImage:SetFocus() )
DEFINE BUTTON OF oWnd:oBar PROMPT "Fit Rect" CENTER ACTION ( oImage:FitRect(), oImage:SetFocus() )
DEFINE BUTTON OF oWnd:oBar PROMPT "Rotate" CENTER ACTION ( oImage:Rotate(), oImage:SetFocus() )
DEFINE BUTTON OF oWnd:oBar PROMPT "Paste" CENTER ACTION ( oImage:lCanPaste := .t.,oImage:Paste(), oImage:SetFocus() )
DEFINE BUTTON OF oWnd:oBar PROMPT "Copy" CENTER ACTION ( oImage:CopyToClipBoard(.t.), oImage:SetFocus() )
@ oWnd:oBar:nHeight,300 XIMAGE oImage SIZE 0,-oWnd:oMsgBar:nHeight ;
OF oWnd RESOURCE "PINGUINO"
WITH OBJECT oWnd
:nWidth := ScreenWidth() * 0.6
:nHeight := ScreenHeight() * 0.6
END
ACTIVATE WINDOW oWnd CENTERED
RELEASE FONT oFont
return nil
Code: Select all | Expand
#ifdef __FLAT__
1 24 "WindowsXP.Manifest"
#endif
PINGUINO RCDATA "..\bitmaps\pngs\2.png"