copy an image from the Windows clipboard - SOLVED
copy an image from the Windows clipboard - SOLVED
Would it be possible, using a dialog with an image resource, to copy an image from the Windows clipboard?
Last edited by MGA on Mon Dec 02, 2024 2:39 pm, edited 1 time in total.
Re: copy an image from the Windows clipboard
Prueba este ejemplo, para ver si te sirve:
el .rc
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"
Re: copy an image from the Windows clipboard
Cuando sea mayor quiero ser como César. jajajajaja.
Gracias César!
Regards, saludos.
Gracias César!
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341