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
The C language itself doesn't have any built-in graphics capability. You can use a graphics toolkit like Qt, gtk, wxWidgets, etc. You could also construct an image file (BMP is pretty simple), and then launch (using fork and exec) an application to view it.
Display an image - designer In Visual Studio, use the Visual Designer to display an image. Open the Visual Designer of the form containing the control to change. Select the control. In the Properties pane, select the Image or BackgroundImage property of the control.
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 );
}
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
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With