Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 05/04/23 in all areas

  1. Don't bother and simply use BigInteger from https://github.com/rvelthuis/DelphiBigNumbers (or rather https://github.com/TurboPack/RudysBigNumbers which seems to be the maintained fork) - it most likely has all operations that you need
  2. programmerdelphi2k

    Assign KeyDown function to btnClick

    maybe some like this help you? same that your Edit/Memo-controls is focused, this works! // a easy way... procedure TForm1.Button1Click(Sender: TObject); begin Label1.Caption := 'message button1'; end; procedure TForm1.Button2Click(Sender: TObject); begin Label1.Caption := 'message button2'; end; procedure TForm1.FormCreate(Sender: TObject); begin Form1.KeyPreview := true; // <---- to OnKeyDown,etc... end; procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if Key = vk_return { and other verifications... } then Button1.Click; end;
  3. Patrick PREMARTIN

    Link to Google Play

    No problem in Android Apps. You can do that. You can also do the same in iOS/macOS apps. Just display only Apple "App Store / Mac App Store" link, not the Android one. And to open the link you can use a library like https://github.com/DeveloppeurPascal/librairies/blob/master/u_urlOpen.pas if you don't know how to do it.
  4. Anders Melander

    Change "FadeOut" code to "FadeIn" code

    That's the ColorModulate function; It "fades" from any color to any color. In your case, you would fade each pixel from black to the color of your new image. Or if you absolutely must have a FadeFromBlack function: // Value = 0: Black // Value = 1: Color function FadeFromBlack(Color: TColor32Entry; Value: Single): TColor32Entry; begin Result.A := Color.A; // Probably 255 Result.R := Round(Color.R * Value); Result.G := Round(Color.G * Value); Result.B := Round(Color.B * Value); end; Apply this to each pixel of your "to" bitmap and draw the resulting bitmap on top of whatever you have on the screen.
  5. PeterBelow

    Assign KeyDown function to btnClick

    Just set the buttons Default property to true, it will then automatically "click" when the user presses Enter/Return and the active control does not handle the key itself. No code needed...
  6. Well, if one could get one's hands on the DirectDraw-Canvas, and the DirectDraw-RenderingContext, one could write a descendent of FMX-TBitmap which uses the higher-quality setting possible with DirectDraw. I just can't see how, but I'm a newbie.
  7. I think it's just a bug in their implementation. They appear to be AND'ing the pixels instead or OR'ing them. Even the GDI's COLORONCOLOR or STRETCH_DELETESCAN methods, which are just about the fastest methods there are, with the worst quality, would produce a better result. Possibly, but the examples on that page are cooked to show the result you want; They only really demonstrate the effect of a downsample followed by a cubic upsample followed by a linear downsample (you've let the browser shrink the final bitmap). A fair comparison would be to compare the unscaled, downsampled results. What the results would look like when upsampled again with a cubic resampler is not relevant to the downsample quality. Original Downsampled, box filter Downsampled, linear filter Downsampled, cubic filter
  8. Rollo62

    write text on image with specific position fmx

    If it's for the purpose of just showing an image with text, I would recommend TImage32, or other libraries. Maybe solutions based on SVG or Skia as well, but TImage32 seems to be the most clean and small solution to just the TImage replacement, with a lot of extras. FMX internally has a lot of Scaling questions, which may drawing on a canvas make it not trivial and different on varous platforms and devices.
  9. programmerdelphi2k

    Assign KeyDown function to btnClick

    you can call the event as: ComponentXXXX.EventNameXXXX( ... params ) -> like do the Form definitions! Button1.OnClick(Self);
  10. Willicious

    Assign KeyDown function to btnClick

    Brilliant, thank you @programmerdelphi2k! This one worked: procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if Key = vk_return { and other verifications... } then Button1.Click; end; And now, I know how to virtually click buttons, which is incredibly helpful 🙂👍
  11. stijnsanders

    RAD Studio Breakpoints not working

    I still find it a valid question. I remember this time I had something similar and fixed it by deleting the project's dcu's, to have compile/build generate all new ones. I don't remember how many Delphi versions ago it was though...
  12. tinyBigGAMES

    AskChatGPT

    Integrate with OpenAI's ChatGPT API seamlessly from Delphi. Features Easily access the GPT API from a single class Supports both GPT3 and GPT4 models API key can be read from ChatGPTApiKey environment variable if defined Automatically sanitizes input to minimize errors Ability to define proxy settings Adjust personality response with a precision range of 0-1, from precise to creative Stream responses just like in the ChatGPT web interface Usage Get your API Key: https://platform.openai.com/account/api-keys Define environment variable ChatGPTApiKey and assigned your API key. You may have to reboot your machine for it to take effect. // Basic example showing how to query ChatGPT uses AskChatGPT; var LChat: TAskChatGPT; begin LChat := TAskChatGPT.Create; try // set chat params LChat.Model := GPT3; // use the GPT3 model, or GPT4 for the GPT4 model LChat.Creative := 1; // 0-1, 0 being most percise and 1 being most creative // ask question LChat.Question := 'What is Delphi?' // print question PrintLn('Q: %s', [LChat.Question]); // process and print response if LChat.Process then PrintLn('A: %s', [LChat.Response]); finally LChat.Free; end; end; Media Download https://github.com/tinyBigGAMES/AskChatGPT
  13. Your handcrafted routine isn't *that* slow, just turn on compiler-optimization. As for resampling, I had started to port my parallel bitmap-resampler to fmx, but then I thought, hey, these guys can use DirectDraw, there won't be a demand. Now, seeing how poor the quality is for (supposedly) bilinear rescaling, I have continued working on it. A first version is usable on Windows only for the time being. I just have to add some demos, and I'll probably upload it later today to https://github.com/rmesch/Parallel-Bitmap-Resampler Just in case you might be interested.
  14. this help you? procedure TForm1.TreeView1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); begin case Key of VK_UP, VK_DOWN: // TreeView1.OnClick(self); Caption := TreeView1.Selected.Text; end; end; I forgot "OnChange" works in mouse/keyboard procedure TForm1.TreeView1Change(Sender: TObject; Node: TTreeNode); begin Caption := Node.Text; end;
  15. Are you talking about the demo, or your own app? If your own app, did you follow the instructions in the readme? Either way, please indicate what version of Android you have on your device.
  16. Patrick PREMARTIN

    write text on image with specific position fmx

    If you want a very simple way (but not optimized) : set a parent for your image (something linked to a form by a way or an other), add a Text component with characteristics your need, set its parent to the TImage, and do a YourImage.MakeScreenShot to get the new bitmap.
×