ATOUTFOX
COMMUNAUTÉ FRANCOPHONE DES PROFESSIONNELS FOXPRO
Visual FoxPro : le développement durable

Forum AtoutFox : Re: PDF => JPEG   

Sujet

rss Flux RSS des derniers messages

Vous devez vous identifier pour pouvoir poser une question ou répondre.

jeu. 14 mars 2013, 17h00
Cesar Ch
Brésil Brésil

atoutfox.public.association

Re: PDF => JPEG

Here's a working sample for you.

REQUIRES the file "SYSTEM.APP" from GdiPlusX

PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN


DEFINE CLASS form1 AS form


  Top = 0
  Left = 0
  Height = 300
  Width = 769
  ShowWindow = 2
  DoCreate = .T.
  Caption = "Form1"
  Name = "Form1"


  ADD OBJECT command1 AS commandbutton WITH ;
    Top = 0, ;
    Left = 0, ;
    Height = 27, ;
    Width = 84, ;
    Caption = "Get file", ;
    Name = "Command1"


  ADD OBJECT text1 AS textbox WITH ;
    Height = 23, ;
    Left = 84, ;
    Top = 3, ;
    Width = 600, ;
    Name = "Text1"


  ADD OBJECT olecontrol1 AS olecontrol WITH ;
    Top = 36, ;
    Left = 0, ;
    Height = 264, ;
    Width = 768, ;
    Anchor = 15, ;
    Name = "Olecontrol1"


  ADD OBJECT command2 AS commandbutton WITH ;
    Top = 0, ;
    Left = 684, ;
    Height = 27, ;
    Width = 84, ;
    Caption = "Capture", ;
    Name = "Command2"


  PROCEDURE Init
    Thisform.Olecontrol1.Width = Thisform.Width
    Thisform.Olecontrol1.Height = Thisform.Height - 30
  ENDPROC


  PROCEDURE command1.Click
    LOCAL lcFile
    lcFile = GETFILE()
    IF (NOT EMPTY(lcFile)) AND (FILE(lcFile))
      Thisform.Text1.Value = lcFile
      Thisform.Olecontrol1.Navigate2(lcFile)
    ENDIF
  ENDPROC


  PROCEDURE olecontrol1.Refresh
    *** ActiveX Control Method ***
    NODEFAULT
  ENDPROC


  PROCEDURE command2.Click
    IF VARTYPE(_Screen.System) <> "O"
      DO LOCFILE("System.App")
    ENDIF

    LOCAL loBmp as xfcBitmap
    loBmp = _Screen.System.Drawing.Bitmap.FromScreen(Thisform.Olecontrol1)
    loBmp.Save("c:\Test1.png", _Screen.System.Drawing.Imaging.ImageFormat.Png)
  ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************


Permalink : http://www.atoutfox.org/nntp.asp?ID=0000011550
20 286 messages dans le forum • Liste complète des messages

www.atoutfox.org - Site de la Communauté Francophone des Professionnels FoxPro - v3.4.0 - © 2004-2026.
Cette page est générée par un composant COM+ développé en Visual FoxPro 9.0-SP2-HF3