I show transparent images on top of another image "bottom".
In this case, the lower (solid) image is a checkerboard grid, and the upper image is a lion (transparent):

= 
The reason is to show areas of transparency much better, because usually you donβt see which areas are transparent.
The problem is that bitmaps can be any size in size, so the grid must also be the same size as the bitmap.
It seems like a dirty approach is to create a larger version of a chessboard grid up to 2000x2000 in size, then depending on the size of the bitmap images you work with, you can resize the canvas canvas to fit, This is not ideal because it means saving a large raster image of the chess grid with your application, and then it means resizing, which may not give the correct results depending on the aspect ratio, etc.
The correct approach, which I believe, is to make the chessboard grid programmatically, for example:
procedure RenderGrid(Source: TBitmap; Height, Width: Integer; Size: Integer; Color1, Color2: TColor); begin end;
This will allow you to configure a grid with different sizes and colors, rather than worry about the overhead of storing a large raster image of a chess grid and the need to resize.
However, I'm not sure how you could draw a grid on a bitmap? I thought you need to scroll through each variable line of the bitmap and color it that way? I'm not sure.
This is due to mathematics and calculations, which I feel bad. I would appreciate it if you could enlighten me with the most efficient way to render a grid to a bitmap image.
user1175743
source share