Good Morning,
Can someone please help me with some source code on how to reduce an image to a fixed size.
Many thanks in advance
Otto
oImage := GdiBmp():New( "c:\fwh\samples\204.jpg" )
oImage:Resize( nWidth, nHeight )
oImage:Save( "newfile.jpg", nQuality )
oImage:End()
#include "FIVEWIN.CH"
function main()
local oImage
local nQuality := 0
local I := 0
local cPfad := "c:\bilder\"
local aDir := directory( cPfad + "*.jpg","DHS")
local cSrc := ""
local nWidth := 800
local nHeight := 600
*----------------------------------------------------------
lMKDir( cPfad + "\klein" )
for I := 1 to len( aDir )
cSrc := aDir[I,1]
oImage := GdiBmp():New( cPfad + cSrc )
oImage:Resize( nWidth, nHeight )
oImage:Save( cPfad + "\klein\" + cFileNoPath( cSrc ) , nQuality )
oImage:End()
next
? "Ende"
return nil
//----------------------------------------------------------------------------//
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 92 guests