PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV Mobile 2024 → Resize Image
Resize Image
Started by adrianoboller, Nov., 24 2014 12:38 PM - No answer
Registered member
3,661 messages
Popularité : +175 (223 votes)
Posted on November, 24 2014 - 12:38 PM
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)