Posted: Thu Jun 16, 2016 9:48 pm Post subject: Open pictures with open dialog
Hi
I make this lua script for "OpenDialog":
Code:
function ButtonOpenClick(sender)
local child1 = control_getParent( sender ); -- button to panel
local child2 = control_getParent( child1 ); -- panel to form
if( frmCheat_ldCheat == nil ) then
print( "its nil" );
end
openDialog_execute( frmCheat_ldCheat );
end
Q1:Now how to make script for open pictures types only(Pictures Types(jpg,png,...))?
Q2:How to make with "OpenDialog" script that when open the picture the dimensions of the form to the size of the picture dimensions?
Joined: 09 May 2003 Posts: 25806 Location: The netherlands
Posted: Fri Jun 17, 2016 5:15 am Post subject:
a1:
if you're using the form designer, then go to the ldCheat object (using the treeview in the object inspector) , go to the filter properties and click on the ... button
in there you can give it a name and in filter the extension you wish (multiple)
if frmCheat.ldCheat.execute() then
local p=createPicture()
p.loadFromFile(frmCheat.ldCheat.FileName)
frmCheat.ClientWidth=p.Bitmap.Width
frmCheat.ClientHeight=p.Bitmap.Height
--and do other things with p like assigning p to a image.Picture or something
end
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping
It's very nice , Thanks Dark Byte for your help.
but i have other problem when click on button and open a picture. But a picture not show in form. Help
DB has already given you the answer to that question.
Dark Byte wrote:
--and do other things with p like assigning p to a image.Picture or something
If you can't figure it out from that, then read main.lua and try to learn from it. Considering you've already been told that multiple times in the past (and you're still using those old undoccumented functions), it's clear you haven't and probably never will do that. _________________
I don't know where I'm going, but I'll figure it out when I get there.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum