Jump to content

Resim İle Drag And Drop Örneği


HalilYanar
 Share

Recommended Posts

Merhaba Arkadaşlar,
 
Drag And Drop ile ilgili akıllarda soru işareti kalmaması için kendimce bir örnek yaptım. Bu örnekte resmi programa bırakınca program üzerinde resim gösteriliyor. Kodları yapıştırarak kullanıcak olanlar Plugins lerden Drag And Drop Pluginini seçmesi gerekir. .apz dosyasınıda indirebilirsiniz. Kasmaması için On Timerde olması gereken kodları On Mouse Move'ye Aldım. Onu kendinizde ayarlayabilirsiniz.
 
x9ZDoNs.png
 
On Show
 
[Spoiler]
hndle = Application.GetWndHandle()
DragAndDrop.SetDataFormat(DataFormat.FileDrop);
DragAndDrop.Start(hndle);
 
hata = DragAndDrop.GetError();
 
if (hata == "") then
 
else
Dialog.Message("Hata", hata);
end
[/Spoiler]
 
On Mouse Move
 
[Spoiler]
nFile = DragAndDrop.GetDataObject();
 
for i,v in pairs(nFile) do
if (String.SplitPath(v).Extension == ".jpg") or (String.SplitPath(v).Extension == ".png") or (String.SplitPath(v).Extension == ".bmp") or (String.SplitPath(v).Extension == ".gif") or (String.SplitPath(v).Extension == ".jpeg") then
Image.Load("Image1", v);
else
Dialog.Message("Hata!", "Sadece belirli formattaki dosyalar atılabilir.", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
end
end
[/Spoiler]
 
 
NOT : Resimdeki klavye benimdir :D
Edited by HalilYanar
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...