Display a picture on a screen without a window

י ל 1 Reputation point
2021-07-01T08:04:39.467+00:00

אני רוצה ליצור קוד שיציג תמונה במסך ללא פתיחת חלון חיצוני כלשהוא, איך ניתן לעשות זאת?
תודה על העזרה


Translated from Hebrew to English:

I want to create code that displays an image on the screen without opening any external window, how do I do it?
Thank you for your help

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,555 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 81,341 Reputation points
    2021-07-01T08:57:29.057+00:00

    You can just draw on the Desktop, but it will be erased if refreshed or by other windows of course (otherwise, you must use a transparent window) :

      Dim hc As Net.Http.HttpClient = New Net.Http.HttpClient()  
                Dim imgBytes = Await hc.GetByteArrayAsync("https://i.ibb.co/3vLqy0j/Butterfly.png")  
                Dim bmp As Bitmap  
                Using ms = New MemoryStream(imgBytes)  
                    bmp = Image.FromStream(ms)  
                    bmp.MakeTransparent()  
                End Using  
                Using gr = Graphics.FromHwnd(IntPtr.Zero)  
                    gr.DrawImage(bmp, 200, 200)  
                End Using  
    

    110875-butterfly-desktop.jpg

    0 comments No comments