Jump to content

Arkaplanı Değiştirmek


peerfen

Recommended Posts

talhanın dediği doğru ama ayarladığımız arkaplanı saklamak mümkün. Şöyle ki;

Sayfanın On Show evresine:

resim = INIFile.GetValue("AutoPlay\\Docs\\data.ini", "ayarlar", "arkaplan")
Application.SetPageProperties("Page1", {BackgroundType=2, ImageFilename="AutoPlay\\Images\\"..resim});[/CODE]

ve Buttonumuza;

[CODE]dosya = Dialog.FileBrowse(true, "Dosya seçin", _DesktopFolder, "Resim Dosyaları (.png, .jpg, .bmp)|*.png;*.jpg;*.bmp|", "", "", false, true);
if dosya ~= "CANCEL" then
File.Copy(dosya[1], _SourceFolder.."\\AutoPlay\\Images", false, true, false, false)
dosyaismi = String.SplitPath(dosya[1])
ayarlar = {};
ayarlar.BackgroundType = BG_IMAGE;    
ayarlar.ImageFilename = "Autoplay\\Images\\"..dosyaismi.Filename..dosyaismi.Extension;
Application.SetPageProperties("Page1", ayarlar)
INIFile.SetValue("Autoplay\\Docs\\data.ini", "ayarlar", "arkaplan", dosyaismi.Filename..dosyaismi.Extension)
end[/CODE]

kodlarını yazarsak seçtiğimiz arka plan saklanacak ve bir dahaki açılışımızda o arkaplanla açılacak. Hem bu kodda dosya seçme penceresi ile istediğimiz dosyayı seçmek mümkün.

Dosaya secerek degilde mesela butona tikladigimizda 1 png arka plan olarak ayarliyacak bunuda ini dosayasina yazacak bunu nasil yapabiliriz

Link to comment
Share on other sites

Şu kodlar Button'un On Click evresine;

ayarlar = {};
ayarlar.BackgroundType = BG_IMAGE;    
ayarlar.ImageFilename = "Autoplay\\Images\\1.png";
Application.SetPageProperties("Page1", ayarlar)
INIFile.SetValue("Autoplay\\Docs\\data.ini", "ayarlar", "arkaplan", "Autoplay\\Images\\1.png")
end[/CODE]

Şu kodlarda Sayfanın On Preload evresine:

[CODE]strBg = INIFile.GetValue("Autoplay\\Docs\\data.ini", "ayarlar", "arkaplan")
ayarlar = {};
ayarlar.BackgroundType = BG_IMAGE;    
ayarlar.ImageFilename = strBg;
Application.SetPageProperties("Page1", ayarlar)[/CODE]

Not: şu an AMS yüklü olmayan bir bilgisayardayım. Kodları test edemedim.

Link to comment
Share on other sites

Sen kodlari yazarsinda olmazmi :good:

sadece end kismi varken hata verdi end i sildim oldu

cok tesekkürler

bir sorum daha var

sayfanin arka planini degistirken butonlarinda degismesini sagliyabilirmiyiz

malum sayfanin arka plani degisince butonlar sayfada siritacak secilen safa ile beraber butonlarda degisse cok iyi olur

Link to comment
Share on other sites

Şu şekilde olması lazım:

Buttonun On Click evresine;

tblButton = {};
tblButton.ButtonFile = "Autoplay\\Docs\\1.btn;    
Button.SetPageProperties("Button1", tblButton)
INIFile.SetValue("Autoplay\\Docs\\data.ini", "ayarlar", "button1", "Autoplay\\Buttons\\1.btn")[/CODE]

Şu kodlarda Sayfanın On Preload evresine:

[CODE]strBtn = INIFile.GetValue("Autoplay\\Docs\\data.ini", "ayarlar", "button1")
tblButton.ButtonFile = strBtn;    
Button.SetPageProperties("Button1", tblButton)
Button.SetPageProperties("Button1", ayarlar)[/CODE]

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...