Zloy_Gelud

Silver Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору gogaman Только возможно создать саммораспоковывающийся архив aka SFX. Ресурсов не будет видно, но при запуске авторан все равно распакует их в %TEMP%. _____________ Вроде кому-то нужен был ресайз изображения... Код: --[[ Расширенная функция загрузки изображения в объект 'Image' Параметры: object (string) - название объекта file (string) - полный путь к изображению resize_mode (number) - тип ресайза: PROPORTIONAL - пропорциональный STRETCH - обычный (растягиваемый) no_enlarge (boolean) - центрировать ли изображение, если оно меньше объекта 'Image' Примеры: Image.LoadEx("Image1", "C:\\1.png", PROPORTIONAL); Image.LoadEx("Image1", "C:\\1.png"); Image.LoadEx("Image1", "C:\\1.png", STRETCH); Image.LoadEx("Image1", "C:\\1.png", PROPORTIONAL, true); --]] function Image.LoadEx(object, file, resize_mode, no_enlarge) if (resize_mode == nil) then resize_mode = 1; end if (no_enlarge == nil) then no_enlarge = true; end local obj_width = Image.GetSize(object).Width; local obj_height = Image.GetSize(object).Height; local obj_x = Image.GetPos(object).X; local obj_y = Image.GetPos(object).Y; local info = Image.GetFileInfo(file); if info then local width, height = info.Width, info.Height; Image.SetVisible(object, false); if (resize_mode == 0) then if no_enlarge then if (width < obj_width) and (height < obj_height) then Image.SetPos(object, obj_x + obj_width / 2 - width / 2, obj_y + obj_height / 2 - height / 2); Image.SetSize(object, width, height); end else if ((width / obj_width) > (height / obj_height)) then Image.SetPos(object, obj_x, obj_y + obj_height / 2 - (height * obj_width / width) / 2); Image.SetSize(object, obj_width, height * obj_width / width); else Image.SetPos(object, obj_x + obj_width / 2 - (width * obj_height / height) / 2, obj_y); Image.SetSize(object, width * obj_height / height, obj_height); end end end Image.Load(object, file); Image.SetVisible(object, true); end end | Добавлено: 777Dima Так будет правильней, имхо: Код: function QueryAllowProjectClose() local cBut= Dialog.Message("System Encoder - \"D\"", "Сохранить изменения ?", MB_YESNOCANCEL, MB_YESNOCANCEL, MB_DEFBUTTON3); if (cBut == IDYES) then Page.ClickObject("Button7"); return true; elseif (cBut == IDNO) then return true; else return false; end end | |