-
Content Count
2829 -
Joined
-
Last visited
-
Days Won
154
Everything posted by Anders Melander
-
How to determine the subjective brightness of my screen?
Anders Melander replied to Der schöne Günther's topic in Algorithms, Data Structures and Class Design
That doesn't answer the question. The overall category is "Delphi" and the Q doesn't have anything to do with Delphi. You have a better chance of getting a usable answer to stuff like this on stackoverflow. -
How to determine the subjective brightness of my screen?
Anders Melander replied to Der schöne Günther's topic in Algorithms, Data Structures and Class Design
What does this have to do with Delphi? -
TimSort for Delphi without Generics
Anders Melander replied to dummzeuch's topic in Algorithms, Data Structures and Class Design
I thought you said that you didn't read books... 🙂 -
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.
-
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.
-
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.
-
So don't use shared dcu output folders. You shouldn't be doing that anyway.
-
Build them in parallel.
-
32bit RGBA TBitmap to RGB byte stream.
Anders Melander replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
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. -
32bit RGBA TBitmap to RGB byte stream.
Anders Melander replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
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? -
Yes but it's a nasty mess. Better than nothing I guess.
-
To use alpha transparency you need to set Transparent=False. Here's what it looks like (Delphi 10.3):
-
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.
-
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.
-
Hashing Street Addresses ?
Anders Melander replied to david_navigator's topic in Algorithms, Data Structures and Class Design
I solve most of my problems in the shower. Eureka! -
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.
-
ANN: Better Translation Manager released
Anders Melander replied to Anders Melander's topic in Delphi Third-Party
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. -
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.
-
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;
-
They are Windows API functions: https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-savedc
-
ANN: Better Translation Manager released
Anders Melander replied to Anders Melander's topic in Delphi Third-Party
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? -
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;
-
Install recent Delphi versions on Windows XP
Anders Melander replied to dummzeuch's topic in Delphi IDE and APIs
Why would you want to do that? Just curious. -
32bit RGBA TBitmap to RGB byte stream.
Anders Melander replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
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? -
32bit RGBA TBitmap to RGB byte stream.
Anders Melander replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
Why wouldn't a profiler, real or not, help there? What do you think a profiler does?