JohnLM 14 Posted August 23, 2023 SPECS: Delphi 11.2, Galaxy S10+ phone (Android 12) (screen size is 6.4 inches) Issue: I want to change the view in the IDE to match my phone but the closest one is the 'Android 5" phone', and when I add componets on the form in that view, after compiling, the controls don't fit the screen and/or are sometimes off the view of the screen. In Delphi XE7, in the View's drop-down list, there is a custom setting option. I think I only used it once for a tablet years ago, but could not figure it all out and gave up. However, in 11.2, there is no listing for custom. So, I was wondering if there are downloadable views, or does the developer has to figure it out manually by eye/try. I've been searching around but cannot find any answers. TIA. Share this post Link to post
Lajos Juhász 293 Posted August 24, 2023 You should define your view in Tools - Options. You can find it if you navigate to User Interface - Form Designer - Device Manager or just write Device manager into the search edit box at the top. https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Adding_a_Device_Preset Share this post Link to post
JohnLM 14 Posted August 30, 2023 (edited) In Delphi 11.2, I found it under Tools\Options\Form Designer\Device manager and I played around in it, but under the field, [Device Background] I could not find an image to use, so it failed to complete without that field being filled in. I believe my Galaxy S10+ pixel display view is 412x869 - per this link https://yesviz.com/devices/s10+/ Edited August 30, 2023 by JohnLM Share this post Link to post
Patrick PREMARTIN 69 Posted August 31, 2023 8 hours ago, JohnLM said: under the field, [Device Background] I could not find an image to use, so it failed to complete without that field being filled in. If you don't have a frame for your device, just put a PNG of the good dimension (at least the size of the screen of the device in pixels). Share this post Link to post
JohnLM 14 Posted September 2, 2023 Okay, I think I know what I can do. 1. I can use the 'Photowall' app, take a picture of a black background (lay the phone face-down) take a photo, and send that to the Photowall app in Windows via app-tethering. 2. update the windows photowall app to capture the bitmap to the clipboard 3. paste that into windows paint 4. edit the image somehow to remove most of the black area (or make it white) and leave a 2 to 4 pixel black edge around the whole dimension. 5. save that to png 6. open in delphi ide, device manager and update the custom view with this new image. I'll call it Galaxy S10+ 7. finish Share this post Link to post
JohnLM 14 Posted September 3, 2023 The above idea did not work out as planned. I did not take into account the camera's photo dimensions. The capture-to-clipboard image was 567x1008 pixels. I believe that I have to capture the form's image instead. That may work. I will try that next, as soon as I return. Share this post Link to post
Patrick PREMARTIN 69 Posted September 4, 2023 why don't you simply use Paint or an other image editor to create a bitmap with the good dimensions ? Share this post Link to post
JohnLM 14 Posted September 4, 2023 (edited) I think its because I believe the the 412x869 dimensions are not true. When I send a photo to my windows machine, the dimensions are very large. I am trying to determine the exact x,y pixels of my device, and its been truely deceptive and annoying. At this moment: * I am trying to figure out how to take a screenshot of my current display--I figure out that part: put a tlayout componet on the form and use layout1.MakeScreenshot;** * I am also trying to re-work the Photowall mobile app to send the bitmap from .MakeScreenshot via stream. But the snippet I updated/edited is not working. The image is not showing in the PhotoWallVCL app on my laptop computer (with the uppdated/edited code in the mobile app). If I REM out the code, it works. So I am in the middle of debugging that portion of code now. ** but I'm not sure how to use tlayout. I've never used it. I assume that whatever components (buttons/edits/etc) I add to it, that when I call .MakeScreenshot it will capture the whole current viewport of the device, whatever is displaying on it. But the problem is, none of the controls are sticking to the tlayout control. That is, none of the controls are bound to it, that if I click and drag the layout1 control, all the controls (buttons/edits/etc) should move with it--but they don't. Edited September 4, 2023 by JohnLM Share this post Link to post
JohnLM 14 Posted September 4, 2023 Okay, I finally figured out the code and where to insert it so that it sends a screenshot of my device (my phone) to my laptop. Now to update the Photowall mobile app to include a TLayout and copy all its controls over to it and then do a screenshot and see how that looks through the PhotoWallVLC app on my laptop. Share this post Link to post
JohnLM 14 Posted September 4, 2023 update. . . regarding the pixel dimensions for the screen size. It appears that the 567x1008 pixels is correct for that Galaxy S10+ Android phone. And, it is 390x520 on the Galaxy A10 Android phone. Now I can move forward in this project. Thanks for all the help/tips/etc., thus far. Share this post Link to post