I would like to know how to open an image without having a window open, so its like the the image is floating on my desktop with no border. thanks
-
This [Link](http://stackoverflow.com/questions/1536141/how-to-draw-directly-on-the-windows-desktop-c) may help you.you need to draw the picture pixel by pixel using the same technic. – Galaxydreams Dec 01 '11 at 22:33
3 Answers
What you want to do is to draw an image on the screen without a visible window border around it. Whether a window will be created is a totally different question. And as it turns out, you have to have a window. It just won't be visible. So:
Create a window, making sure to set the following in InitializeComponent()
:
this.ControlBox = false;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.ShowIcon = false;
this.ShowInTaskbar = false;
Then, override OnPaintBackground
for that window, as follows:
protected override void OnPaintBackground( WinForms.PaintEventArgs e )
{
e.Graphics.DrawImage( Image, 0, 0, Width, Height );
}

- 56,297
- 11
- 110
- 142
If all you want is a splash screen, there's a framework component for that: http://msdn.microsoft.com/en-us/library/system.windows.splashscreen.aspx

- 1,835
- 11
- 13
Show a window without the title bar
In case of winforms -
FormBorderStyle = None
ControlBox = false
taken from - Windows Form with Resizing Frame and no Title Bar?
In case of XAML use this to show window without title bar -
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="640" Height="480"
WindowStyle="None"
AllowsTransparency="True"
ResizeMode="CanResizeWithGrip">
<!-- Content -->
</Window>
taken from - Is it possible to display a wpf window without an icon in the title bar?

- 1
- 1

- 9,256
- 4
- 38
- 51