Jayme McColgan Posted September 25, 2023 Share Posted September 25, 2023 (edited) I'm trying to apply an image to a surface. I got all the code I need except for how to apply the image I just imported... I've tried vs.SetFPat() and vs.SetTextureRefN() with no luck. ### getting handle (h) from eariler in code texture_image = vs.ShowCreateImageDialog() if texture_image != 0: newtex_name = f"QR_CODE_{datetime.datetime.now()}" vs.SetName(texture_image, newtex_name) ledtext = vs.Name2Index(newtex_name) vs.SetObjectVariableLongInt(h, 695, -10) ### vs.whateverapplysanimage() haha vs.SetObjectVariableBoolean(h,79,False) vs.SetObjectVariableReal(h,70,-((vs.HWidth(h)/2)*25.4)) # X pos vs.SetObjectVariableReal(h,71,-((vs.HHeight(h)/2)*25.4)) # Y pos vs.SetObjectVariableReal(h,72,(vs.HWidth(h))*25.4) #width vs.SetObjectVariableReal(h,73, (vs.HHeight(h))*25.4) #height vs.SetObjectVariableReal(h,74,0) #rotate vs.SetObjectVariableBoolean(h,75,False) vs.SetObjectVariableBoolean(h,76,False) vs.SetObjectVariableBoolean(h,77,False) vs.SetObjectVariableBoolean(h,697,False) vs.SetObjectVariableBoolean(h,1160,True) Edited September 25, 2023 by Jayme McColgan i can't spell... Quote Link to comment
Jayme McColgan Posted September 25, 2023 Author Share Posted September 25, 2023 (edited) I figured it out... I needed to set the fill pattern to a negative number. vs.SetFPat(h, ledtext * -1) Edited September 25, 2023 by Jayme McColgan Quote Link to comment
Recommended Posts
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.