Jump to content

JohnLM

Members
  • Content Count

    288
  • Joined

  • Last visited

Everything posted by JohnLM

  1. JohnLM

    Is there a way to create a photo capture toobar?

    Well, I added to the Public section. I made sure that it was still working (the process), and then I removed that TButton, btn. I was going to hide the button if I was still going to use it. But now that I am no longer using it, I don't have to hide it. Public procedure ImageClick(Sender: TObject);
  2. JohnLM

    Is there a way to create a photo capture toobar?

    @Stano -- it took me a moment, but I got what you meant and took care of it, thanks. Oh, and I figured out how to make the border around the images thicker, using: image1.Canvas.Pen.Width:=5;
  3. JohnLM

    Is there a way to create a photo capture toobar?

    Thank you to Lajos and Stano for your solutions. Very appreciated! I learned something new. I just wish there was a way to show the progress(s) in action so that you and others can visualize the app in action.
  4. JohnLM

    Is there a way to create a photo capture toobar?

    @Stano -- and your solution works, thanks. procedure TForm1.btnClick(Sender: TObject); begin if Sender is TImage then begin var Im := TImage(Sender); eb1.Text := im.tag.ToString; case Im.tag of 1: begin end; 2: beep; // IM_2 was clicked, so produce a audible tone 3: begin end; end; end; end;
  5. JohnLM

    Is there a way to create a photo capture toobar?

    @Lajos Juhász -- your solution works (thanks) as long as I modify the code as follows: procedure TForm1.btnClick(Sender: TObject); var c: TComponent; begin // -- Lajos c := FindComponent('IM_'+TButton(Sender).Tag.ToString); eb1.Text := c.Tag.ToString; // show the tag id (the image clicked) end;
  6. JohnLM

    Is there a way to create a photo capture toobar?

    re building an custom event, or crude wrapper event. . . I have an idea that might work but it requires me to add an additional parameter to an event for the TButton, recall I gave it the name, 'btn'. Normally, the .onclick event looks like this: procedure TForm1.btnClick(Sender: TObject); begin end; To get my idea to possibly work, I will need to add an additional parameter to this, thus making it now look like this: procedure TForm1.btnClick(Sender: TObject; _tag: integer); begin end; Then, I will write the following code: procedure TForm1.btnClick(Sender: TObject; _tag: integer); begin with TImage(Form1.FindComponent('IM_' + inttostr(_tag))) do begin beep; // show the imagelist's image that was clicked on, in the main image. image1.picture.assign( TImage(Form1.FindComponent('IM_' + inttostr(_tag))) ); end; end ...as a test to see if it does what I am hoping it will do, which is, beep and show the larger image for the main image when a given timage is clicked on in the custom imagelist area. Thus, the TButton, btn's event will activate, beep and show a larger image for the main image. Again, I know nothing about events and how to create or modify them--unless someone shows me how. Otherwise, this project will be on hold for a very long time since I have to figure this all out. But if/when I do, I will update this topic.
  7. JohnLM

    Is there a way to create a photo capture toobar?

    @Stano - re Point 3: I have not figured out how to set an event to the TImages yet. I'm having trouble with it. I believe I have to assign an Event to the image each time I dynamically create one. If I click on IM_2 for instance, nothing happens since there is no event because these images are created dynamically at runtime and I set the .Parent to the Scrollbox. I am still researching this portion. But once I figure out how, then I can scroll up/down this custom imagelist and mouse-select on the image and that image will get shown on the main image on the left side. re the Event, or fake wrapper event.. What I have tried so far is this: 1. create a very small button, i.e., [:] -- I gave the button .name, btn, and the .caption as '[:]' to make it small and not as noticeable. (If I can't figure out how to write an event to dynamically created TImages, then this button will be hidden later on when it's finally working.) 2. in the button's properties, I added an .onClick event 3. I write some code in the .onClick event and added code to sound a Beep (for testing purposes, to see which image in the custom imagelist I have clicked on). Here is some code snippet thus far. Everything works: (adding images and scrolling up/down in the image list) but the event is not, which is the Button's event at the moment. var Form1: TForm1; cnt: integer = 0; StepCntr: integer = -105; posse: integer = 0; im: timage; implementation {$R *.dfm} // add a TImage to the imagelist inside the TScrollbox // evey time [add] button is clicked, a new TImage is dynamically created and added to the imagelist // procedure TForm1.btnAddClick(Sender: TObject); begin // Note: im (the TImage) var is before the Implementation area. // dynamically create single TImage, and assign its .Parent to Scrollbox // and assign an .onclick event via a hidden [:] button. // // use that button's even code (below) to test which .Tag indicates which TImage // is clicked on. // im := timage.Create(self); im.Parent := sb1; im.OnClick := btn.OnClick; // intialize the TImage and calc its placement within the Scrollbox. // // keep track of the .Tag so we can use that as the indicator for which // TImage is clicked on in the imagelist area. // // The var cnt (or index, is a counter) to hold each TImage as ID (stored in the .Tag propery) so // that we can use that in the [:] button's logic to determin which TImage // was clicked and call the routine to show *that* image to the main image. // // the var StepCntr is to calc the image placement. // // And, for the portion of the project, I am writing via .Textout the image // name onto the image, so that I can keep track of what I am calling, etc. // inc(cnt); im.Tag:=cnt; // assign it an index no. inc(StepCntr, 105+3); im.Name := 'IM_'+intTostr(cnt); // assign im a name, i.e., IM_1, IM_2, ... IM_10 im.top := StepCntr+3; im.Left := 3; im.Width := 105; im.Height := 105; im.Canvas.TextOut(30, 40, 'IM_'+inttostr(cnt)); // create border around image in custom imagelist. // im.Canvas.Brush.Style := bsClear; im.Canvas.Pen.Color := clBlue; im.Canvas.Rectangle(im.ClientRect); end; procedure TForm1.btnClick(Sender: TObject); begin // a fake but crude wrapper event to test weather clicking an individual // image in the imagelist is working. // case im.tag of 1: begin end; 2: beep; // we clicked on IM_2, so produce a audible tone 3: begin end; end; end;
  8. JohnLM

    Is there a way to create a photo capture toobar?

    Progress. . . I have made some progress in this project. I can now: 1. dynamically create a new Image inside a Scrollbox -- I had lots of trouble with this. At first I was using TPaintbox but border/image would disappear when moving window around. Now, I am using a TImage instead. It works. 2. and add a border around it - I had trouble figuring that out. also added border around main image, im1. 3. add text to it (showing the component name, i.e., (im1, im2, ... im10 and so on) -- had trouble with aligning text in each image. 4. I can also scroll up/down through the imagelist with the wheelmouse. Next steps: 1. is to get the screenshots into the main image and the image list inside the scrollbox. 2. possibly add a global hot-key -- Using the clipboard I can assign the image to the main image and then pass that on to the *new* image, as if I press the [add] button, but through code. I am considering adding a global hot-key to this part of the process..., when I screenshot the window or whole desktop screen, add it to the main image and imagelist. 3. when I click on one of the images in the imagelist, to somehow have that image give the illusion of setfocus or something. I haven't quiet figure on a solution yet. Maybe make the border around the image thicker. But at the moment, I could not figure that out -- if anyone know how, please explain, thanks. 4. to add a save-all to save all the images into one file. I have not figure that out yet either. One idea is to use a Zip archive. But another could be to save all the images into one stream, and then Load the images from the stream back into the imagelist. The one thing I regret in this topic is the subject title. I should have said, imagelist. Oh well.
  9. In the Welcome screen, the Learn videos portion is available and comes up on my 6GB Win10 tablet, under Delphi 11 and 12. I have both those IDE's working fine together. Infact, have them both running right now. But on my Win7 laptop with D11, the Learn videos portion does not come up. Actually, it has not come up in many weeks or longer. I prefer to watch videos on my 15" win7 laptop. Yes! I still use Windows 7 !! I have a few Windows 10 devices. But Win7 is still my main machine. @Vandrovnik so funny, LoL
  10. JohnLM

    Is there a way to create a photo capture toobar?

    The images would be coming from the clipboard and would be in the same size dimensions. For instance, when I am screenshotting Amazon or Ebay, I will take the whole screen, including the bottom statusbar/date/time area for proof of date and time. The saving part would come after I've finished the screenshot session(s). I would have to figure out how to combine all the images into one, or save them in a zip and Load the zip back into the toolbar list. I haven't quite figured those parts as yet. There are plenty of zip resources to google up. Not that anyone has brought this up but.. I've never worked with ImageList's. And last I remembered, the images have to be no larger than 32x32 dimensions. And, I can't just paste from the clipboard into it. I would have to reduce the size of the clipboard images down to 32x32, save them individually and then load them into the ImageList. So, the ImageList component in Delphi is out of the question. I am looking in Delphi 12 to see if there are any new image type components. Then I google whatever info I can find on how to use them.
  11. specs: Win7 and Win10 In all my casual searches, I've never seen any kind of request for this. I have an app that writes the date/time down. Now, I would like to utilize it every time Windows startup or shutdown, but also when I put Windows in sleep mode and wake up from sleep, and also for Windows logon/logoff mode. I will mostly be using it during Windows sleep modes, but I need it for shutdown as well. Where do I put my app to make this happen?
  12. Remy, unfortunately, Windows 7 Home Premium does not come with any group policy editors, so that is out of the question. The gpedit.msc app does not exist on this laptop.
  13. Hi, I take many photos with my Android phone. And now I need a way to Add some search text to the image so that I can find the photos. With a custom image viewer app I will create in conjunction with the metadata reader/writer, my search method would be to open the phone's Gallary (I don't know how to do this yet) and then enter a search word and only photos that match will show, like the way they do when you are in the Gallary app. I searched around and see references for ccr-exif but it is for Delphi VCL, not FMX/Android. Is there a Delphi unit that provides this or someplace where I can download a working project to accomplish this ? TIA.
  14. I'm building a front-end gui to a dos console app. And I am utilizing the TIniFile to read/write to a settings.ini file. I need help with ideas of typical methods or algorithms for creating a rolling or recent folder location list, of say, the last 5 folder locations for a 'dos console app' that I call. The location can be the hdd, flash drive, or another laptop/tablet. The folder locations will be obtained through the FileOpenDialog, so flash drives, mem sticks, etc., could change in a given scenario. I currently have a small settings.ini file that holds just a few things at the moment, thus.. [app settings:] app path=H:\D11\VCL\Misc\enc_gui\v01\Win32\Debug\ last video src path:=J:\Tools\portable\ last video dst path:=F:\dst\ But I would like to add a recent list of last folder locations for this ini file for where the 'dos console app' will be pickd and stored so that I can extract that from the ini file and load it into a listbox and have a quick pick-list to choose from when I move from one device or folder location. I sometimes jump from my laptop to my tablet, or throw in a flash/mem drive, and having this quick picklist would work well in my work-flow. TIA.
  15. Thanks to dummzeuch for the hint he made: '..read all entries in the section [mru].' I googled and found that there is a function, ReadSectionValue() that I can call and read the values into a list. But continuing after that point I ran into some roadblocks. I need to check for duplicates and exclude them from being added back into the ini file. I eventually figured that portion out using a TStringList: { setting .sorted:=true } and { setting .duplicates:=dupIgnore }. I don't want the final list sorted, so I will have to maintain another list to keep the original unsorted list for the updated ini file. @ Remy I will look into your suggestion(s) for the remaining parts. Thanks. I will post the finished portions of how I managed it when I figure the rest out.
  16. I have never worked with ini files in Delphi, so this is the first time for me to dive into it, add to that, I want to incorporate a rolling list feature that I have to control with some logic (algo).
  17. JohnLM

    Delphi 12 entry in start menu

    I mainly use Windows 7, and if I launch Delphi enough times, it will show up, like it is now, for Delphi 11 on my main win7 laptop that I use daily, 24-7. My maximum app count is 15. If I start using another app a given number of times, the entry for 'Delphi 11' (it is the last one showing on the bottom of the start menu) will get bumped off and replaced with the latest commonly used app in its place.
  18. JohnLM

    Delphi 12 entry in start menu

    Okay, here is the solution. . . Windows 7 -- but not sure how-to in win10 1. right-click start menu 2. select [Start Menu] 3. [ ] uncheck 'Store and display recently opened programs in the start menu' 4. done
  19. JohnLM

    Delphi 12 entry in start menu

    This is not an answer solution to your issue, but I have noticed that this is typical Windows trying to help you by putting commonly used apps that the user launches, eventually go to the start menu. I do not know what the app's launch count is that will trigger adding it to the start menu. But I am sure there is a setting somewhere to turn that feature off.
  20. JohnLM

    Removing String

    Here is my version of a (string) removal for this practice: function StrRemove(s: string; StrToRemove:string): string; begin while pos(strToRemove,s,1) <> 0 do begin // recursive if pos(strToRemove, s,1) > 0 then delete(s,pos(strToRemove,s,1),length(strToRemove)); end; result := s; end; // call with var s: string; begin s := 'This is (string) which (string) need to (remove).'; s := StrRemove(s,'(string)'); s := StrRemove(s,'(remove)'); end;
  21. JohnLM

    Removing String

    Serge_G's routine works, including when multiples of, i.e., (string) .. (string) But it does not remove the extra spaces. And Trim() does not remove the spaces in-between char/strings unless the original string includes spaces at the first and last position, i.e., Trim(' This is (string) which (string) need to (remove) ') --- works Trim('This is (string) which (string) need to (remove)') --- fails So, the routine would require more work/additional code.
  22. JohnLM

    Removing String

    ..or here.
  23. After receiving my windows activation key for my new tablet, and after it "upgraded" my windows 10, to "Windows 10 2022 Update | Version 22H2" I was no longer able to access the windows sytem settings app. It sometimes pops up as a blank blue dialogbox with the familiar gear in the center, and then closes. For instance, when I right-click the desktop, and select 'Display settings' I get this error message (after the blue dialog box with the gear pops up and closes). "This file does not have an app associated with it for performing this action. Please install an app or, if one is already installed, create an association in the Default Apps Settings page." Or, when I try to open the Settings app directly, or Windows key+I, or from any place or method of activating Settings, I get this (below) and then it closes in a second or two. The following are things I have tried, I believe are all that I have tried so far: 1. open cmd and enter - sfc /scannow 2. open cmd and enter - Dism /Online /Cleanup-Image /CheckHealth 3. open cmd and enter - Dism /Online /Cleanup-Image /ScanHealth 4. open cmd and enter - Dism /Online /Cleanup-Image /RestoreHealth 5. open powershell and enter - * PowerShell -ExecutionPolicy Unrestricted -Command "& {$manifest = (Get-AppxPackage *immersivecontrolpanel*).InstallLocation + '\AppxManifest.xml' ; Add-AppxPackage -DisableDevelopmentMode -Register $manifest}" 6. open powershell and enter - * Get-AppXPackage -AllUsers -Name windows.immersivecontrolpanel | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register “$($_.InstallLocation)\AppXManifest.xml” -Verbose} 7. open powershell and enter - * Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml" -verbose} I've also tried a few of the registry hacks but they did not help. So now I am wondering what else can I do. Something in the 22H2 messed up the Settings's app's association. And I can't run a Settings Repair because I have to be in Settings to do that. Does anyone else have suggestions for me to try. I can create a system restore point and then try your suggestion(s). TIA
  24. Update. . . re windows boot up problems is now resolved. All is back to normal. I managed to get a system Restore point from a dos prompt and am now back to the previous windows 10 22H2 state prior to my removing most of the updates. Oh well. At least I'm back up and running. I'm glad I made the choice to create a Restore point after all since I could not get Macrium to restore an image. I will have to figure that one out.
×