PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → Resize Image
Resize Image
Débuté par adrianoboller, 24 nov. 2014 12:38 - Aucune réponse
Membre enregistré
3 651 messages
Popularité : +175 (223 votes)
Posté le 24 novembre 2014 - 12:38
Procedure CAM_ResizeImage(LOCAL PathFileOrigemJpg is string, LOCAL PathFileDestinoJpg, LOCAL Horizontal, LOCAL Vertical, LOCAL DebugSN)

IF gsDebugSN = "S"
DebugSN="S"
END

IF Horizontal = "" OR Horizontal = 0 OR Vertical = "" OR Vertical = 0 THEN
Info("Não foi definido o tamanho Horizontal e Vertical da imagem")
ok = False
END

IF PathFileOrigemJpg <> "" AND PathFileDestinoJpg <> ""

HReadSeekFirst(T000Config,T000Config.CodConfig000,27)
IF HFound(T000Config) = True AND T000Config.Valor000 <> "" THEN
Horizontal = Middle(T000Config.Valor000,1,3)
Vertical = Middle(T000Config.Valor000,5,3)

ok = VideoGenerateThumbnail(PathFileOrigemJpg, PathFileDestinoJpg, Horizontal, Vertical)

ELSE

ok = VideoGenerateThumbnail(PathFileOrigemJpg, PathFileDestinoJpg, 640, 480)

END

IF fFileExist(PathFileDestinoJpg) THEN
IF ok = True AND DebugSN = "S"
Info("Redimensionamento realizado com sucesso!")
ok = True
END
ELSE
IF DebugSN = "S"
Info("Falha no redimensionamento da imagem!")
ok = False
END
END

ELSE

Info("Nome da imagem não foi definido!...")
ok = False

END

RESULT(ok)