copy an image from the Windows clipboard - SOLVED

Post Reply
MGA
Posts: 1254
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá
Contact:

copy an image from the Windows clipboard - SOLVED

Post by MGA »

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.
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
User avatar
cmsoft
Posts: 1293
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: copy an image from the Windows clipboard

Post by cmsoft »

Prueba este ejemplo, para ver si te sirve:

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
el .rc

Code: Select all | Expand

#ifdef __FLAT__
   1 24 "WindowsXP.Manifest"
#endif

PINGUINO RCDATA "..\bitmaps\pngs\2.png"
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: copy an image from the Windows clipboard

Post by karinha »

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
Post Reply