FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour copy an image from the Windows clipboard - SOLVED
Posts: 1286
Joined: Mon Feb 25, 2008 02:54 PM
copy an image from the Windows clipboard - SOLVED
Posted: Sat Nov 30, 2024 01:27 PM

Would it be possible, using a dialog with an image resource, to copy an image from the Windows clipboard?

ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
Posts: 1344
Joined: Wed Nov 16, 2005 09:14 PM
Re: copy an image from the Windows clipboard
Posted: Sat Nov 30, 2024 05:03 PM
Prueba este ejemplo, para ver si te sirve:
Code (fw): Select all Collapse
#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
el .rc
Code (fw): Select all Collapse
#ifdef __FLAT__
   1 24 "WindowsXP.Manifest"
#endif

PINGUINO RCDATA "..\bitmaps\pngs\2.png"
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: copy an image from the Windows clipboard
Posted: Sat Nov 30, 2024 08:00 PM

Cuando sea mayor quiero ser como César. jajajajaja.

Gracias César!

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1286
Joined: Mon Feb 25, 2008 02:54 PM
Re: copy an image from the Windows clipboard
Posted: Mon Dec 02, 2024 02:39 PM

Cesar,

That's fantastic, thank you very much.

ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin

Continue the discussion