Announcement

Collapse
No announcement yet.

Was Bored- Wrote rescaler for HSTouch projects

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Was Bored- Wrote rescaler for HSTouch projects

    ** Sorry, but my last update had a broken zip file and nothing would happen when the EXE was run, it has been fixed **



    Something like this might be floating around here, but I got tired of maintaining my HSTouch projects in two sizes, one for my EVO and one for my iPhone and decided to do something about it.

    I now only create my larger screen master project and deploy it to my EVO. Then I run the attached HSTouch project rescaler and deploy the rescaled version to my iPhone.

    The app is drop-dead dumb. I wrote it in about an hour. It works for me and I have no idea if it will work for you. If there is anything at all non-standard in your project it will likely make smoke come out of your CPU and eat your first-born children.

    Just run it and point it to your HSTouch project XML file, set the desired output dimensions, and Press Start. It will parse your project and create a new project with the same name as the input but with "_rescaled" added.

    It doesn't scale any graphics itself, it uses the built-in scaling for that. I might have it load the graphics and scale them using a high-quality scaler at some point, but not tonight.

    It does handle landscape and portrait screens in the same file properly.

    Let me know if it does anything useful for you.

    (It is .NET 4.0)

    Jon

    JonOrt At AutomationCraft dOt com
    Attached Files
    Last edited by Oman; March 14, 2012, 11:09 PM. Reason: Attachment - What attachment?
    Jon Ort
    JonOrt@The--Orts.com
    (Remove the dashes in the address, spam is getting out of hand)

    #2
    I thought I should make an improvement or two now that the project is one day old...

    I realized that I had properly scaled graphics for the two resolutions I was moving between. I had setup the proper structure, so why not use the proper graphics if they are available (and it can be done automatically?)

    So here is what it does...

    Lets say your original project is 240x320. If you are grabbing a file from \iSkins\Backgrounds\240x320\Brushed-Pewter.jpg and you are moving to a project that is 320x240, the converter will check for a graphic file called \iSkins\Backgrounds\320x240\Brushed-Pewter.jpg and use that one instead. Cool.

    Also if you have a reference to an object like iSkins\Graphics\Custom\800 Wide Bar.jpg where your original project is 800x600 and you are going to 1024x768 it will check for iSkins\Graphics\Custom\1024 Wide Bar.jpg and use that if it is there.

    I added a check box to control this option and fixed a few bugs and made it a bit less dumb.

    The build was updated in the original post.

    Jon


    Originally posted by S.Morris
    Thanks,
    Might come in handy when the new Ipad 3 comes out with its large resolution
    Jon Ort
    JonOrt@The--Orts.com
    (Remove the dashes in the address, spam is getting out of hand)

    Comment


      #3
      Very good! I will help out a little more, I now have a version of the Android client that automatically scales the screens to fit the device's screen. I have tried it on many devices and it works ok, except on the Kindle Fire. Once I figure that out I will post a beta for testing. The Designer has a new option that allows you to enable the auto-resizing. So far this is for Android only.
      💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

      Comment


        #4
        Would love to try a release/beta of that!

        --Dan
        Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

        Comment


          #5
          Was Borked

          The update to the EXE I put up last night was broken. It is now fixed. As a bonus the rescaler supports the ability to rescale taking into account the Andriod 4.0 button bar that moves when you tilt the device. On a Xoom it is 60 pixels.

          Jon


          Originally posted by drozwood90 View Post
          Would love to try a release/beta of that!

          --Dan
          Jon Ort
          JonOrt@The--Orts.com
          (Remove the dashes in the address, spam is getting out of hand)

          Comment


            #6
            Originally posted by Oman View Post
            **and eat your first-born children.

            ...
            How exactly do you invoke this feature


            Thanks for making this tool available. Very cool indeed. And just in time for my nook color project.
            -Tim

            HSPro - 3.XXX - Dell mini W7 x32
            Way2 Call
            Elk M1 Gold
            UPB HAI switches
            HAI RC2000 Thermostat

            Comment


              #7
              Hi and thanks, this is what I need to all my different devices.
              Have tried the rescaler on different hstouch project but the only I get is:
              "Input string had an incorrect format"

              The last debug line is when I get the message.
              Adjusting Widget Type 'HS_Listbox' in screen 'Devices' Named 'Device Selector'

              If I compare the orginal file with 43 000 lines with the new rescaled one that only have 1132 lines.


              Start Compare Line 1127 (Orginal file)
              PHP Code:
              <BackImageFile>\Android\Buttons\Back-norm.png</BackImageFile>
                              <
              BackImageFileSelected>\Android\Buttons\Back-pressed.png</BackImageFileSelected>
                              <
              ImageFormatSelected>Stretched</ImageFormatSelected>
                              <
              BackColor>16777215</BackColor>
                              <
              BackColorSelected>16777215</BackColorSelected>
                              <
              _BorderStyle>None</_BorderStyle>
                              <
              _IsHTML>false</_IsHTML>
                              <
              _AllowNavigation>false</_AllowNavigation>
                              <
              _HonorAllReleases>false</_HonorAllReleases>
                              <
              _Visible>true</_Visible>
                              <
              Text /> 
              Start Compare Line 1127 (Rescaled file)
              PHP Code:
                <BackImageFile>\Android\Buttons\Back-norm.png</BackImageFile>
                              <
              BackImageFileSelected>\Android\Buttons\Back-pressed.png</BackImageFileSelected>
                              <
              ImageFormatSelected>Stretched</ImageFormatSelected>
                              <
              BackColor>16777215</BackColor>
                              <
              BackColorSelected>16777215</BackColorSelected>
                              <
              _BorderSt 
              I tried to remove/replace all underscore in all <_ and </_ and it run almost 3 extra lines.

              PHP Code:
                              <BackImageFile>\Android\Buttons\Back-norm.png</BackImageFile>
                              <
              BackImageFileSelected>\Android\Buttons\Back-pressed.png</BackImageFileSelected>
                              <
              ImageFormatSelected>Stretched</ImageFormatSelected>
                              <
              BackColor>16777215</BackColor>
                              <
              BackColorSelected>16777215</BackColorSelected>
                              <
              BorderStyle>None</BorderStyle>
                              <
              IsHTML>false</IsHTML>
                              <
              AllowNavigation>false</AllowNavigation 
              Any suggestions?
              Please excuse any spelling and grammatical errors I may make.
              --
              Tasker Plugin / Speech Droid
              Tonlof | Sweden

              Comment


                #8
                I have .net version 4 which this won't run on.
                Am I running the best version?
                Tks
                HS4Pro Win10 | Fire Tablet touchscreen client, Android Phones and Tablets | Jon00 | Smartthings | Philips Hue | Trane | Caseta | Nanoleaf | Ring | August | Evolve | Aladdin | Amazon Alexa/IFTT

                Comment


                  #9
                  Im trying to rescale but im getting an error. any idea what im doing wrong?
                  Attached Files
                  Certified installer for HomeSeer, Control4, KNX and Eaton/xComfort

                  Comment


                    #10
                    That sounds awesome Rich!

                    Thanks Gary

                    Comment


                      #11
                      I have used this great tool in the past, but recently it is giving me only errors, and tries to rescale to another Width and Height then entered. Any chance this tool is still compatible with the current XML format?
                      stefxx

                      Comment


                        #12
                        Have used this on xml generated by Designer v3.0.80 and it still works fine

                        Comment


                          #13
                          Originally posted by email68 View Post

                          Originally posted by Oman View Post

                          **and eat your first-born children.

                          ...

                          How exactly do you invoke this feature


                          .
                          Pretty sure it's baked into Windows update.
                          https://forums.homeseer.com/forum/de...plifier-plugin

                          Comment


                            #14
                            Just marking this thread so I can refer to it.

                            Comment


                              #15
                              +1 this is useful/interesting....might come in handy for the new projects

                              Comment

                              Working...
                              X