/*
*
* ConvertImage.xml
*
*/
function OnConvertImageEvent_ComboSelChanged(pPlusWnd, sControlId) {
if (pPlusWnd.Combo_GetCurSel(sControlId) === 1) {
_win32.ShowWindow(objWindows['ConvertImage'].GetControlHandle('lblText2'), _win32._const._SW_SHOW);
_win32.ShowWindow(objWindows['ConvertImage'].GetControlHandle('sldrQuality'), _win32._const._SW_SHOW);
} else {
_win32.ShowWindow(objWindows['ConvertImage'].GetControlHandle('lblText2'), _win32._const._SW_HIDE);
_win32.ShowWindow(objWindows['ConvertImage'].GetControlHandle('sldrQuality'), _win32._const._SW_HIDE);
}
}
function OnConvertImageEvent_CtrlClicked(pPlusWnd, sControlId) {
switch (sControlId) {
case 'BtnConvert':
var sPath = objPreferences['tSaveDirectory']+ '\\';
var sOldImage = pPlusWnd.GetControlText('lblImageName'),
sNewImage = pPlusWnd.GetControlText('lblImageName').substr(0, pPlusWnd.GetControlText('lblImageName').lastIndexOf('.') + 1);
var oGdip = new Gdip();
oGdip.Initialize();
oGdip.ConvertImage(sPath + sOldImage, sPath + sNewImage + aImageFormats[pPlusWnd.Combo_GetCurSel('cFileType')].toLowerCase(), aImageFormats[pPlusWnd.Combo_GetCurSel('cFileType')], pPlusWnd.SendControlMessage('sldrQuality', _win32._const._TBM_GETPOS, 0, 0));
objWindows['ScreenshotViewer'].ImageElmt_SetImageFile('ImgPreview', 'pixel.png');
_win32.ShowWindow(objWindows['ScreenshotViewer'].GetControlHandle('lnkRefreshImage'), _win32._const._SW_HIDE);
_win32.ShowWindow(objWindows['ScreenshotViewer'].GetControlHandle('lnkEditImage'), _win32._const._SW_SHOW);
var sImage = sPath + sNewImage + aImageFormats[pPlusWnd.Combo_GetCurSel('cFileType')].toLowerCase();
objWindows['ScreenshotViewer'].SetControlText('lblImageSize', _lang.text['ScreenshotViewer_Size'] + ' '
+ oGdip.FormatFileSize(oGdip.GetImageSizeInBytes(sImage)));
objWindows['ScreenshotViewer'].SetControlText('lblImageDimensions', _lang.text['ScreenshotViewer_Dimensions'] + ' '
+ oGdip.GetImageDimensions(sImage));
objWindows['ScreenshotViewer'].SetControlText('lblImageCreated', _lang.text['ScreenshotViewer_DateCreated'] + ' '
+ oGdip.GetDateCreated(sImage));
oGdip.Uninitialize();
RefreshScreenshotViewerList();
CloseWindow('ConvertImage');
break;
}
}