Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: KatzYaakov on August 09, 2019, 10:14:38 AM

Title: add image
Post by: KatzYaakov 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
Title: Re: add image
Post by: Chaoticone 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")
Title: Re: add image
Post by: KatzYaakov 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
Title: Re: add image
Post by: dws 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")
Title: Re: add image
Post by: KatzYaakov 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 ?
Title: Re: add image
Post by: dws 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".