Hello Guest it is May 17, 2021, 06:28:55 PM

Author Topic: add image  (Read 400 times)

0 Members and 1 Guest are viewing this topic.

add image
« on: August 09, 2019, 10:14:38 AM »
hi
can i add mine image ?i c that there option to add image  on screen but i didnt see where i can use mine bit map
second question is if i can add image  ,can i change it in run time ,like from m function or buton or plc?
thanks
yaakov

Offline Chaoticone

*
  • *
  •  5,626 5,626
  • Precision Chaos
    • View Profile
Re: add image
« Reply #1 on: August 09, 2019, 11:28:15 AM »
Yes and yes.

Operator, Edit Screen, Screen, Manage Images, Add

To change the image of a screen entity define the image of whatever property it is relative to using scr.SetProperty. All property names are visible in screen edit mode when you click the entity.

scr.SetProperty("SceenEntityName", "Bg Image", "MyImage.png")

or

scr.SetProperty("SceenEntityName", "Image Up", "MyImage.png")
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: add image
« Reply #2 on: August 11, 2019, 04:34:08 PM »
hi
i try add image with name Label
i add that function on screen load


function image()
   scr.SetProperty("Label","image","\\Profiles\\Mach4Mill\\Modules\\0.png" )
   
end
  i put that 0.png on the correct path ,but nothing happened
where is my mistake?
thanks

Offline dws

*
  •  24 24
    • View Profile
Re: add image
« Reply #3 on: August 11, 2019, 10:04:07 PM »
See this video on how to add images to Mach4: https://www.youtube.com/watch?v=P1xZkFgS5cQ

Then you can call the image as per Chaoticone's directions. eg: scr.SetProperty("Label", "Image", "0.png")
« Last Edit: August 11, 2019, 10:10:01 PM by dws »
David
Re: add image
« Reply #4 on: August 11, 2019, 11:47:46 PM »
i already did it ,but the function not work,(i work with mach 4 more then 1 years and i real made many things with it and real like it)

in yours first answer you mention
 "Bg Image",
"Image Up"
 where is this 2 proprieties ? i didn't find them on image ?

Offline dws

*
  •  24 24
    • View Profile
Re: add image
« Reply #5 on: August 12, 2019, 12:33:24 AM »
It depends on what kind of item you choose to put the image on. For example if you choose a toggle button, you can set the image properties for "Image Up" or "Image Dn". For the Image item, you can set different images for only the Image Property. For other items such as Group Container or Tabs, you can add an image to "Bg Image".

David