Jump to content

Anders Melander

Members
  • Content Count

    2772
  • Joined

  • Last visited

  • Days Won

    147

Everything posted by Anders Melander

  1. What does this have to do with Delphi?
  2. I thought you said that you didn't read books... 🙂
  3. Anders Melander

    Uniqueness and Security of domain name

    As Davis said it really depends on the level of security you need. Since the users will presumably have unlimited access to the client binaries the best you can hope for is security through obscurity. Once you accept that your choice depends on the value (to the user) of the assets you are trying to protect. You just need to make circumventing your protection sufficiently costly (in time) for the user that they won't bother. Since I don't know any of those metrics I can't really recommend a solution. Yes. Everyone can setup a domain controller and name is anything they want.
  4. Anders Melander

    Uniqueness and Security of domain name

    It's not secure at all. Nothing prevents someone from setting up a local PC, or even a VM, with the same config as one on your domain.
  5. Anders Melander

    Compile speed ide vs MsBuild

    My build server runs all builds in parallel. I don't do it locally as I don't need to build more than one project at a time there.
  6. Anders Melander

    Compile speed ide vs MsBuild

    So don't use shared dcu output folders. You shouldn't be doing that anyway.
  7. Anders Melander

    Compile speed ide vs MsBuild

    Build them in parallel.
  8. It's obvious that you, at some point in your pipeline, have the bitmaps in a TBitmap, but it's not obvious if this is actually necessary. If you don't have a requirement that the bitmaps need to be represented as a TBitmap then you can avoid the whole GDI overhead by simply loading the bitmaps as a memory stream and accessing the pixel data directly in memory. BMP is a fairly simple and well defined format so it's not that hard. You can also use something like Graphics32 to do this for you since this seems to be about 32-bit bitmaps exclusively.
  9. Your TRGB32 type is identical to TRGBQuad. Why have you declared the TRGB32Array array packed? It serves no purpose. Why do you use TWICImage but also explicitly reference the Jpeg unit? One thing that I don't think you've mentioned, or at least I can't remember, is if you actually need to use TBitmap at all. Where does your bitmap data originate? A disk file, a stream, something else?
  10. Anders Melander

    32bit bitmap

    Yes but it's a nasty mess. Better than nothing I guess.
  11. Anders Melander

    32bit bitmap

    To use alpha transparency you need to set Transparent=False. Here's what it looks like (Delphi 10.3):
  12. Anders Melander

    32bit bitmap

    If you're using Delphi 7 then you will have to use 3rd party components. For example Graphics32 - and better hurry because I plan to drop support for Delphi 7 in Graphics32 the first chance I get.
  13. Anders Melander

    32bit bitmap

    Works fine for me. Here's a form with two TImage controls, one overlapping the other. The top one contains a 32-bit bitmap with alpha, the bottom a PNG. I have set Image1.Transpartent=False and Image1.Picture.Bitmap.AlphaFormat=afDefined (at run-time) for the bitmap.
  14. Anders Melander

    Hashing Street Addresses ?

    I solve most of my problems in the shower. Eureka!
  15. Anders Melander

    Issue about calling Canvas.Polygon

    Yes, they're designed to be nested. I have no idea about why it doesn't work though. Maybe TCanvas gets confused when the HDC is modified outside its control.
  16. Anders Melander

    ANN: Better Translation Manager released

    In newer versions of Delphi there's an project option "Output resource string .drc file" but I don't believe that it's there in Delphi 5. Since Delphi 5 was the first version to include the ITE and the ITE uses DRC files it must be possible somehow. I have the Delphi 5 files on my system but I'm afraid I don't have it installed so I can't run it to find out. Maybe try to compile with the "detailed map file" linker option enabled and see if that makes a difference.
  17. Anders Melander

    Issue about calling Canvas.Polygon

    I know the SaveDC/RestoreDC doesn't solve your problem. In my code it's just there to leave the canvas in the same state as it was in when I got it. The key point from my code was the clearing of the pen handle since in my case I had problems with the pen color. Try reversing the order of the pen and brush assignments. I've had similar problems and as far as I remember that was what I did to solve it.
  18. Anders Melander

    Issue about calling Canvas.Polygon

    My mistake. The ACanvas in my code is a DevExpress TcxCanvas - I didn't think about that. I think that if you use SaveDC/RestoreDC with a TCanvas then you'll need to lock the canvas to guard against the DC being changed. Something like this: ACanvas.Lock; try SaveDC(ACanvas.Handle); try ... finally RestoreDC(ACanvas.Handle, -1); end; finally ACanvas.Unlock; end;
  19. Anders Melander

    Issue about calling Canvas.Polygon

    They are Windows API functions: https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-savedc
  20. Anders Melander

    ANN: Better Translation Manager released

    I've just read the Delphi 5 help and as far as I can see Delphi 5 does produce DRC files. What makes you say it doesn't?
  21. Anders Melander

    Issue about calling Canvas.Polygon

    I use the following to draw corners (top-right in this example): const CornerSize = 8; var Triangle: array[0..2] of TPoint; begin ACanvas.SaveDC; try ACanvas.Brush.Color := clRed; ACanvas.Brush.Style := bsSolid; ACanvas.Pen.Handle := 0; // Work around for messed up pen handle sporadically causing line not to be drawn ACanvas.Pen.Color := GetHighLightColor(ACanvas.Brush.Color); ACanvas.Pen.Style := psSolid; Triangle[0].X := AViewInfo.BoundsRect.Right-1; Triangle[0].Y := AViewInfo.BoundsRect.Top; Triangle[1].X := Triangle[0].X - CornerSize; Triangle[1].Y := Triangle[0].Y; Triangle[2].X := Triangle[0].X; Triangle[2].Y := Triangle[0].Y + CornerSize; ACanvas.Polygon(Triangle); finally ACanvas.RestoreDC; end;
  22. Anders Melander

    Install recent Delphi versions on Windows XP

    Why would you want to do that? Just curious.
  23. You're the only one talking about timers, but even if you used a grandfather clock the method would work. If you break the application at random you will have 50% higher likelihood of hitting lineB than lineA and each time you do this the likelihood increases. This is exactly how a sampling profiler works. Are you saying sampling profilers are a hoax?
  24. Why wouldn't a profiler, real or not, help there? What do you think a profiler does?
  25. Yes, of course that didn't do anything. Why would you expect it to? I think you need to take a step back and think about what you are doing instead of just trying random stuff. Take control of the problem. The numbers you have posted shows that you are either measuring time in microseconds or using the thousand separator incorrectly. If you are measuring microseconds then stop that. Numbers that small are not relevant here. One of the first things you should have done would be to locate the bottleneck by profiling your code. If you don't have a profiler or don't understand how to use one then you can emulate a sampling profiler by just running the application a few times and pause it in the debugger. Unless the slowdown is evenly distributed then there's a statistic likelihood that the call stack will show you where the application is spending the majority of its time.
×