|
-
Dec 15th, 2002, 08:13 AM
#1
Thread Starter
Addicted Member
Drawing in VB.NET question
OK, the following code will take a BMP file and draw it to a main form dialog window. HOW do I make it draw to the dekstop background on my screen instead of onto the form dialog? Take out the "Inherits Form"?
By the way, I DONT want to change the wallpaper, just draw over the current one. Is this possible? Kinda like an overlay.
VB Code:
Imports System
Imports System.Windows.Forms
Imports System.Drawing
Public Module modmain
Sub Main()
'The KPD-Team 2001
'URL: [url]http://www.allapi.net/dotnet/[/url]
Dim theForm as MainForm = new MainForm()
theForm.ShowDialog()
End Sub
End Module
Public Class MainForm
Inherits Form
Dim BackGround as new Bitmap("C:\Windows\Bubbles.bmp")
Protected Overrides Sub OnPaint(e as PaintEventArgs)
e.Graphics.DrawImage(BackGround, new Point(0, 0))
End Sub
End Class
-- Ethan --
www.ethan-c-allen.com
Last edited by ethanwa; Dec 15th, 2002 at 08:19 AM.
VB6, VB.NET, C#, SQL, XML, ADO.NET, ASP.NET, HTML.
MCP & A+ Certified. Looking for a job in the Seattle, WA area.
-
Dec 15th, 2002, 11:18 AM
#2
PowerPoster
You may be able to make the form transparent. Then do your drawing.
-
Nov 16th, 2004, 02:04 AM
#3
Fanatic Member
When I did this before in vb6, I used to use the GDI BitBlt function with GetDesktopWindow + GetWindowHDC. This should still work in vb .net
BTW, any ideas on how to do this with GDI+?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|