Olá,
É possível, usando FREEIMAGE.DLL capturar a imagem que esta em uma determinada janela (dialog/window) e gravá-la no formato .JPG ?
Obrigado,
Rossine.
#include "FiveWin.ch"
FUNCTION MAIN()
LOCAL oDlg, oImg
DEFINE DIALOG oDlg SIZE 700, 500
@ 2, 1 IMAGE oImg FILE "FIVEWIN.BMP" SIZE 200, 200 ADJUST
@3, 2 say "Texto Teste" color rgb( 255,255,255), rgb(255,0,0)
@ 0, 1 BUTTON "Save" ACTION msgstop( iif( oImg:SaveImage( "TESTE", 2 ), "Image saved", "Image not saved. Why ??" ) )
@ 0, 7 BUTTON "Load" ACTION msgstop( iif( oImg:LoadImage( , "TESTE.JPG" ), oImg:refresh(), "Image not load" ) )
@ 0, 13 BUTTON "Print" ACTION PRINT( oImg )
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
STATIC FUNCTION PRINT( oImg )
LOCAL oPrn
PRINT oPrn PREVIEW MODAL
PAGE
oPrn:SayImage( 0, 0, oImg, oPrn:nHorzRes(), oPrn:nVertRes() )
ENDPAGE
ENDPRINT
RETURN NIL
...
@ 0, 1 BUTTON "Save" ACTION msgstop( iif( SaveJPG( oImg ), "Image saved", "Image not saved. Why ??" ) )
...
function SaveJPG( oImg )
local hBitmap := oImg:hBitmap
local lResult := .t.
oImg:hBitmap = WndBitmap( oImg:hWnd )
lResult = oImg:SaveImage( "TESTE.JPG", 2 )
DeleteObject( oImg:hBitmap )
oImg:hBitmap = hBitmap
return lResult
#include "FiveWin.ch"
FUNCTION Main()
LOCAL oWnd
DEFINE WINDOW oWnd TITLE "Progress"
ACTIVATE WINDOW oWnd ;
ON CLICK oWnd:SaveToBmp( "test.bmp" )
RETURN NIL
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 45 guests