Good afternoon. Is it possible to display a specific image on the monitor in the upper left corner? If so, how? It is advisable to use the TImage component. Thanks in advance. It is necessary that the picture be displayed on top of all windows, but it does not interfere with the work (to work and "admire" the picture))))

    3 answers 3

    without details the first thing that comes to mind: you create a form with the parameters BorderStyle = bsNone; WindowState = wsMaximized; on it TImage with the loaded picture in property Pucture and voila

    • Plus, add FormStyle = fsStayOnTop - toxicdream

    Create a Timage object on the form. Add a picture to it.
    In the program code, we specify that the dimensions of the image coincide with the dimensions of the Timage object (the height, width properties) as well as the size of the form ... Make the form in the upper left corner (Top, Left properties) Good luck.

      If you need to access the screen and draw a picture on top of all windows on it, here’s the code:

        procedure TForm1.BitBtn2Click (Sender: TObject);
       Var
         ScreenDC: HDC;  // screen handle
         ScreenCanvas: TCanvas;  // screen outline
         Bitmap: TBitMap;  // bitmap if Image AutoSize = False
       begin
         ScreenDC: = GetDC (0);
         ScreenCanvas: = TCanvas.Create;  // create canvas
         ScreenCanvas.Handle: = ScreenDC;  // pass the screen handle 

      If (Image.AutoSize) Then ScreenCanvas.Draw (0, 0, Image.Picture.Graphic) // draw the entire picture Else Begin // drawing a piece of a picture Bitmap: = TBitMap.Create; BitMap.Assign (Image.Picture.Bitmap); // load in bitmap // customize the size of bitmap BitMap.Width: = Image.Width; BitMap.Height: = Image.Height; ScreenCanvas.Draw (0, 0, Bitmap); // draw a piece BitMap.Free; End;

      // destroy everything I created before ReleaseDC (0, ScreenDC); ScreenCanvas.Free; end;

      If you move a window over this picture (or maximize the screen) or click on a shortcut, then a part of the picture will be erased, so that you can erase it entirely. If Image AutoSize = False, and Stretch = True, then only the piece that would be visible if Stretch = False is drawn.