473,385 Members | 1,357 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to eliminate Tiling of windows forms background images

I want to place a background image on a windows form. Is there a way to
prevent the image from Tiling without using an image box resized to the size
of the form?
I am using Visual Studio 2003 .NET. This is an easy thing to do in VB6.
Jul 21 '05 #1
8 3725
Hi,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need the background image size to
be the same as client rectangle by stretching instead of tiling. If there
is any misunderstanding, please feel free to let me know.

As far as I know, this cannot be implemented so simply as in VB6. We can
try to override the OnPaint event to achieve this. When painting, we just
use Graphics.DrawImage to draw the particular bitmap to the client area.
Here is an example:

private void Form1_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
Bitmap b = new Bitmap(@"D:\My Documents\My Pictures\untitled.bmp");
e.Graphics.DrawImage(b,
this.ClientRectangle.X,this.ClientRectangle.Y,this .ClientRectangle.Width,
this.ClientRectangle.Height);
}

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #2
Hi,
Thank you for your reply. Yes, you have a complete understanding of my
problem. I am a visual basic programmer and will have to study your C# code
closely to see if I can glean a vb method to accomplish importing my image
file using the OnPaint event. Thank you again for your response. Are you able
to provide an example of this procedure in visual basic code? Thanks again.

"Kevin Yu [MSFT]" wrote:
Hi,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need the background image size to
be the same as client rectangle by stretching instead of tiling. If there
is any misunderstanding, please feel free to let me know.

As far as I know, this cannot be implemented so simply as in VB6. We can
try to override the OnPaint event to achieve this. When painting, we just
use Graphics.DrawImage to draw the particular bitmap to the client area.
Here is an example:

private void Form1_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
Bitmap b = new Bitmap(@"D:\My Documents\My Pictures\untitled.bmp");
e.Graphics.DrawImage(b,
this.ClientRectangle.X,this.ClientRectangle.Y,this .ClientRectangle.Width,
this.ClientRectangle.Height);
}

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #3
Of course, here is the VB.NET code.

Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim b As New System.Drawing.Bitmap("D:\My Documents\My
Pictures\untitled.bmp")
e.Graphics.DrawImage(b, Me.ClientRectangle.X, Me.ClientRectangle.Y,
Me.ClientRectangle.Width, Me.ClientRectangle.Height)
End Sub

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #4
Ron,
In addition to (instead of) handling the Paint event as Kevin showed, I
would consider overriding the OnPaintBackground method, as the
OnPaintBackground is the method that paints the background.

Something like:

Protected Overrides Sub OnPaintBackground(ByVal e As PaintEventArgs)
If Me.BackgroundImage Is Nothing Then Exit Sub
e.Graphics.DrawImage(Me.BackgroundImage, Me.ClientRectangle)
End Sub

NOTE: You do not want (or need) to call MyBase.OnPaintBackground as you are
painting the entire background.

http://msdn.microsoft.com/library/de...roundtopic.asp

The following articles discusses the OnPaintBackground method:
http://msdn.microsoft.com/library/de...rmscontrol.asp

Hope this helps
Jay

"Ron Holmes" <vb**********@noemail.nospam> wrote in message
news:A2**********************************@microsof t.com...
Hi,
Thank you for your reply. Yes, you have a complete understanding of my
problem. I am a visual basic programmer and will have to study your C#
code
closely to see if I can glean a vb method to accomplish importing my image
file using the OnPaint event. Thank you again for your response. Are you
able
to provide an example of this procedure in visual basic code? Thanks
again.

"Kevin Yu [MSFT]" wrote:
Hi,

First of all, I would like to confirm my understanding of your issue.
From
your description, I understand that you need the background image size to
be the same as client rectangle by stretching instead of tiling. If there
is any misunderstanding, please feel free to let me know.

As far as I know, this cannot be implemented so simply as in VB6. We can
try to override the OnPaint event to achieve this. When painting, we just
use Graphics.DrawImage to draw the particular bitmap to the client area.
Here is an example:

private void Form1_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
Bitmap b = new Bitmap(@"D:\My Documents\My Pictures\untitled.bmp");
e.Graphics.DrawImage(b,
this.ClientRectangle.X,this.ClientRectangle.Y,this .ClientRectangle.Width,
this.ClientRectangle.Height);
}

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #5
Please excuse my stupidity but I upgraded my vb6 program to

VS .NET 2003 and in my VB6 application, I stored the Form1

Background_Picture in my applications emts.ini file. During

the Form1 load event I use the following procedure to get

the backgroung picture location and file name:

In my VB6 BAS Module I have defined pix globally:

Public pix as string

'Procedure to Get the Form1.Picture from emts.ini

pix = VBGetPrivateProfileString("Background_Picture",

"Path", "c:\Program Files\Holmes

Industries\Megatech32\emts.ini")

Next, I used the following procedure to load the file as

the Form1 background:

Form1.DefInstance.BackgroundImage = System.Drawing.Image.FromFile(pix)

This caused the objectionable Tileing that I was

describing.

I placed the code that you so kindly sent me, into my

form1 Paint event and replaced the "D:\My Documents\My

Pictures\untitled.bmp" with the global value pix as shown

here:

Dim b As New System.Drawing.Bitmap("D:\My Documents\My

Pictures\untitled.bmp") AS

Dim b As New System.Drawing.Bitmap(pix)

and now I can't figure out how to call the Form1_Paint

procedure as the call wants an event as sender ( the e

variable in your code ).

e.Graphics.DrawImage(b, Me.ClientRectangle.X, Me.ClientRectangle.Y,
Me.ClientRectangle.Width, Me.ClientRectangle.Height)

I would like the background to load automatically during the form load
procedure but without the Tiling?????

Thank you for all of your help.
After 10 years of using VB3, VB4, VB5 and recently VB6, I never knew how
little I know about programming until I tried using VS .NET 2003. You are
suggestion I consider overriding the OnPaintBackground method and I am
realizing that I don't know how to do this. I know I am asking too much but
this is very confusing. I wrote a very involved program to track equipment
maintenance problems. My VB6 application's executible is over 6 MB in size
and really works quite well and I never heard of any of this. What should I
do next after the form1_Load code shown below?

'Procedure to Get the Form1.Picture from emts.ini

pix = VBGetPrivateProfileString("Background_Picture", "Path", "c:\Program
Files\Holmes Industries\Megatech32\emts.ini")

Next, I used the following procedure to load the file as the Form1 background:

Form1.DefInstance.BackgroundImage = System.Drawing.Image.FromFile(pix)

This is when the background Tiling appeared.

I think the RAD (Rapid Application Development) name is wishful thinking. At
least until you learn the 10 thousand other things you never knew about,
while using the former languages. I admire you guys who have attained the MVP
rating, and I know you know what I mean when I say this new language is
confusing. Thank you for replying to my cry for HELP!!!
Do I Paste the code below in the Form1_Paint event?

Protected Overrides Sub OnPaintBackground(ByVal e As PaintEventArgs)
If Me.BackgroundImage Is Nothing Then Exit Sub
e.Graphics.DrawImage(Me.BackgroundImage, Me.ClientRectangle)
End Sub
If I do paste this code... where does the picture file information go?
"Jay B. Harlow [MVP - Outlook]" wrote:
Ron,
In addition to (instead of) handling the Paint event as Kevin showed, I
would consider overriding the OnPaintBackground method, as the
OnPaintBackground is the method that paints the background.

Something like:

Protected Overrides Sub OnPaintBackground(ByVal e As PaintEventArgs)
If Me.BackgroundImage Is Nothing Then Exit Sub
e.Graphics.DrawImage(Me.BackgroundImage, Me.ClientRectangle)
End Sub

NOTE: You do not want (or need) to call MyBase.OnPaintBackground as you are
painting the entire background.

http://msdn.microsoft.com/library/de...roundtopic.asp

The following articles discusses the OnPaintBackground method:
http://msdn.microsoft.com/library/de...rmscontrol.asp

Hope this helps
Jay

"Ron Holmes" <vb**********@noemail.nospam> wrote in message
news:A2**********************************@microsof t.com...
Hi,
Thank you for your reply. Yes, you have a complete understanding of my
problem. I am a visual basic programmer and will have to study your C#
code
closely to see if I can glean a vb method to accomplish importing my image
file using the OnPaint event. Thank you again for your response. Are you
able
to provide an example of this procedure in visual basic code? Thanks
again.

"Kevin Yu [MSFT]" wrote:
Hi,

First of all, I would like to confirm my understanding of your issue.
From
your description, I understand that you need the background image size to
be the same as client rectangle by stretching instead of tiling. If there
is any misunderstanding, please feel free to let me know.

As far as I know, this cannot be implemented so simply as in VB6. We can
try to override the OnPaint event to achieve this. When painting, we just
use Graphics.DrawImage to draw the particular bitmap to the client area.
Here is an example:

private void Form1_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
Bitmap b = new Bitmap(@"D:\My Documents\My Pictures\untitled.bmp");
e.Graphics.DrawImage(b,
this.ClientRectangle.X,this.ClientRectangle.Y,this .ClientRectangle.Width,
this.ClientRectangle.Height);
}

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Jul 21 '05 #6
Ron,
the Form1 background:

Form1.DefInstance.BackgroundImage = System.Drawing.Image.FromFile(pix)
I would set BackgroundImage in the Load event with the following:
Me.BackgroundImage = System.Drawing.Image.FromFile(pix)
Simply to ensure that all instances of the form have the property set.

and now I can't figure out how to call the Form1_Paint
procedure as the call wants an event as sender ( the e
variable in your code ). You DO NOT call it as its a form level event, the form itself will call it
when it needs to be called.

VB (.NET, 1, 2, 3, 4, 5, 6) 101. Paint is an event handler for the form
itself, you need to select the Paint event from combo boxes at the top of
the editor to add a handler for the Paint event. Which will add a routine
such as:

Private Sub MainForm_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
' Kevin's code
End Sub

Alternatively you can override the OnPaint method, as the OnPaint method
raises the Paint event (this should have been explained in the link I gave).

' you can (and should) use the following instead of the above
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e) ' important this needs to be called!
' Kevin's code
End Sub

OnPaintBackground is only an overriden method.
Protected Overrides Sub OnPaintBackground(ByVal e As PaintEventArgs)
If Me.BackgroundImage Is Nothing Then Exit Sub
e.Graphics.DrawImage(Me.BackgroundImage, Me.ClientRectangle)
End Sub
The paint event (Paint or OnPaint) & OnPaintBackground are automatically
called by the form itself when the form needs to be painted (when you or
windows calls Form.Update either directly or indirectly). This should also
have been explained in the link I gave.

You should only use Paint event or OnPaintBackground routine, not both.

Again the link I gave should explain when to use on or the other.

Hope this helps
Jay

"Ron Holmes" <vb**********@noemail.nospam> wrote in message
news:8A**********************************@microsof t.com... Please excuse my stupidity but I upgraded my vb6 program to

VS .NET 2003 and in my VB6 application, I stored the Form1

Background_Picture in my applications emts.ini file. During

the Form1 load event I use the following procedure to get

the backgroung picture location and file name:

In my VB6 BAS Module I have defined pix globally:

Public pix as string

'Procedure to Get the Form1.Picture from emts.ini

pix = VBGetPrivateProfileString("Background_Picture",

"Path", "c:\Program Files\Holmes

Industries\Megatech32\emts.ini")

Next, I used the following procedure to load the file as

the Form1 background:

Form1.DefInstance.BackgroundImage = System.Drawing.Image.FromFile(pix)

This caused the objectionable Tileing that I was

describing.

I placed the code that you so kindly sent me, into my

form1 Paint event and replaced the "D:\My Documents\My

Pictures\untitled.bmp" with the global value pix as shown

here:

Dim b As New System.Drawing.Bitmap("D:\My Documents\My

Pictures\untitled.bmp") AS

Dim b As New System.Drawing.Bitmap(pix)

and now I can't figure out how to call the Form1_Paint

procedure as the call wants an event as sender ( the e

variable in your code ).

e.Graphics.DrawImage(b, Me.ClientRectangle.X, Me.ClientRectangle.Y,
Me.ClientRectangle.Width, Me.ClientRectangle.Height)

I would like the background to load automatically during the form load
procedure but without the Tiling?????

Thank you for all of your help.
After 10 years of using VB3, VB4, VB5 and recently VB6, I never knew how
little I know about programming until I tried using VS .NET 2003. You are
suggestion I consider overriding the OnPaintBackground method and I am
realizing that I don't know how to do this. I know I am asking too much
but
this is very confusing. I wrote a very involved program to track equipment
maintenance problems. My VB6 application's executible is over 6 MB in size
and really works quite well and I never heard of any of this. What should
I
do next after the form1_Load code shown below?

'Procedure to Get the Form1.Picture from emts.ini

pix = VBGetPrivateProfileString("Background_Picture", "Path", "c:\Program
Files\Holmes Industries\Megatech32\emts.ini")

Next, I used the following procedure to load the file as the Form1
background:

Form1.DefInstance.BackgroundImage = System.Drawing.Image.FromFile(pix)

This is when the background Tiling appeared.

I think the RAD (Rapid Application Development) name is wishful thinking.
At
least until you learn the 10 thousand other things you never knew about,
while using the former languages. I admire you guys who have attained the
MVP
rating, and I know you know what I mean when I say this new language is
confusing. Thank you for replying to my cry for HELP!!!
Do I Paste the code below in the Form1_Paint event?

Protected Overrides Sub OnPaintBackground(ByVal e As PaintEventArgs)
If Me.BackgroundImage Is Nothing Then Exit Sub
e.Graphics.DrawImage(Me.BackgroundImage, Me.ClientRectangle)
End Sub
If I do paste this code... where does the picture file information go?
"Jay B. Harlow [MVP - Outlook]" wrote:
Ron,
In addition to (instead of) handling the Paint event as Kevin showed, I
would consider overriding the OnPaintBackground method, as the
OnPaintBackground is the method that paints the background.

Something like:

Protected Overrides Sub OnPaintBackground(ByVal e As PaintEventArgs)
If Me.BackgroundImage Is Nothing Then Exit Sub
e.Graphics.DrawImage(Me.BackgroundImage, Me.ClientRectangle)
End Sub

NOTE: You do not want (or need) to call MyBase.OnPaintBackground as you
are
painting the entire background.

http://msdn.microsoft.com/library/de...roundtopic.asp

The following articles discusses the OnPaintBackground method:
http://msdn.microsoft.com/library/de...rmscontrol.asp

Hope this helps
Jay

"Ron Holmes" <vb**********@noemail.nospam> wrote in message
news:A2**********************************@microsof t.com...
> Hi,
> Thank you for your reply. Yes, you have a complete understanding of my
> problem. I am a visual basic programmer and will have to study your C#
> code
> closely to see if I can glean a vb method to accomplish importing my
> image
> file using the OnPaint event. Thank you again for your response. Are
> you
> able
> to provide an example of this procedure in visual basic code? Thanks
> again.
>
> "Kevin Yu [MSFT]" wrote:
>
>> Hi,
>>
>> First of all, I would like to confirm my understanding of your issue.
>> From
>> your description, I understand that you need the background image size
>> to
>> be the same as client rectangle by stretching instead of tiling. If
>> there
>> is any misunderstanding, please feel free to let me know.
>>
>> As far as I know, this cannot be implemented so simply as in VB6. We
>> can
>> try to override the OnPaint event to achieve this. When painting, we
>> just
>> use Graphics.DrawImage to draw the particular bitmap to the client
>> area.
>> Here is an example:
>>
>> private void Form1_Paint(object sender,
>> System.Windows.Forms.PaintEventArgs e)
>> {
>> Bitmap b = new Bitmap(@"D:\My Documents\My Pictures\untitled.bmp");
>> e.Graphics.DrawImage(b,
>> this.ClientRectangle.X,this.ClientRectangle.Y,this .ClientRectangle.Width,
>> this.ClientRectangle.Height);
>> }
>>
>> HTH.
>>
>> Kevin Yu
>> =======
>> "This posting is provided "AS IS" with no warranties, and confers no
>> rights."
>>
>>


Jul 21 '05 #7
Thanks Kevin and Jay,
I finally get it. After reading the articles that Jay refered me to, It all
makes sense.
Kevins code makes sense as well as the code supplied by Jay.
You both are extremely knowledgeable.
When I become more knowledgeable, I think I will also share my hard learned
skills with others as you both, and others, are doing. I will take a lesson
from Jay, and direct the programmer to MSDN articles that describe in debth,
the principles involved. It brings me to mind, the old saying "You can give a
man a fish and feed him for a day, or you can teach him to fish and feed him
forever". (or something to that efect) smile...

Thanks guys.

"Jay B. Harlow [MVP - Outlook]" wrote:
Ron,
the Form1 background:

Form1.DefInstance.BackgroundImage = System.Drawing.Image.FromFile(pix)


I would set BackgroundImage in the Load event with the following:
Me.BackgroundImage = System.Drawing.Image.FromFile(pix)


Simply to ensure that all instances of the form have the property set.

and now I can't figure out how to call the Form1_Paint
procedure as the call wants an event as sender ( the e
variable in your code ).

You DO NOT call it as its a form level event, the form itself will call it
when it needs to be called.

VB (.NET, 1, 2, 3, 4, 5, 6) 101. Paint is an event handler for the form
itself, you need to select the Paint event from combo boxes at the top of
the editor to add a handler for the Paint event. Which will add a routine
such as:

Private Sub MainForm_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
' Kevin's code
End Sub

Alternatively you can override the OnPaint method, as the OnPaint method
raises the Paint event (this should have been explained in the link I gave).

' you can (and should) use the following instead of the above
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e) ' important this needs to be called!
' Kevin's code
End Sub

OnPaintBackground is only an overriden method.
Protected Overrides Sub OnPaintBackground(ByVal e As PaintEventArgs)
If Me.BackgroundImage Is Nothing Then Exit Sub
e.Graphics.DrawImage(Me.BackgroundImage, Me.ClientRectangle)
End Sub


The paint event (Paint or OnPaint) & OnPaintBackground are automatically
called by the form itself when the form needs to be painted (when you or
windows calls Form.Update either directly or indirectly). This should also
have been explained in the link I gave.

You should only use Paint event or OnPaintBackground routine, not both.

Again the link I gave should explain when to use on or the other.

Hope this helps
Jay

"Ron Holmes" <vb**********@noemail.nospam> wrote in message
news:8A**********************************@microsof t.com...
Please excuse my stupidity but I upgraded my vb6 program to

VS .NET 2003 and in my VB6 application, I stored the Form1

Background_Picture in my applications emts.ini file. During

the Form1 load event I use the following procedure to get

the backgroung picture location and file name:

In my VB6 BAS Module I have defined pix globally:

Public pix as string

'Procedure to Get the Form1.Picture from emts.ini

pix = VBGetPrivateProfileString("Background_Picture",

"Path", "c:\Program Files\Holmes

Industries\Megatech32\emts.ini")

Next, I used the following procedure to load the file as

the Form1 background:

Form1.DefInstance.BackgroundImage = System.Drawing.Image.FromFile(pix)

This caused the objectionable Tileing that I was

describing.

I placed the code that you so kindly sent me, into my

form1 Paint event and replaced the "D:\My Documents\My

Pictures\untitled.bmp" with the global value pix as shown

here:

Dim b As New System.Drawing.Bitmap("D:\My Documents\My

Pictures\untitled.bmp") AS

Dim b As New System.Drawing.Bitmap(pix)

and now I can't figure out how to call the Form1_Paint

procedure as the call wants an event as sender ( the e

variable in your code ).

e.Graphics.DrawImage(b, Me.ClientRectangle.X, Me.ClientRectangle.Y,
Me.ClientRectangle.Width, Me.ClientRectangle.Height)

I would like the background to load automatically during the form load
procedure but without the Tiling?????

Thank you for all of your help.
After 10 years of using VB3, VB4, VB5 and recently VB6, I never knew how
little I know about programming until I tried using VS .NET 2003. You are
suggestion I consider overriding the OnPaintBackground method and I am
realizing that I don't know how to do this. I know I am asking too much
but
this is very confusing. I wrote a very involved program to track equipment
maintenance problems. My VB6 application's executible is over 6 MB in size
and really works quite well and I never heard of any of this. What should
I
do next after the form1_Load code shown below?

'Procedure to Get the Form1.Picture from emts.ini

pix = VBGetPrivateProfileString("Background_Picture", "Path", "c:\Program
Files\Holmes Industries\Megatech32\emts.ini")

Next, I used the following procedure to load the file as the Form1
background:

Form1.DefInstance.BackgroundImage = System.Drawing.Image.FromFile(pix)

This is when the background Tiling appeared.

I think the RAD (Rapid Application Development) name is wishful thinking.
At
least until you learn the 10 thousand other things you never knew about,
while using the former languages. I admire you guys who have attained the
MVP
rating, and I know you know what I mean when I say this new language is
confusing. Thank you for replying to my cry for HELP!!!
Do I Paste the code below in the Form1_Paint event?

Protected Overrides Sub OnPaintBackground(ByVal e As PaintEventArgs)
If Me.BackgroundImage Is Nothing Then Exit Sub
e.Graphics.DrawImage(Me.BackgroundImage, Me.ClientRectangle)
End Sub
If I do paste this code... where does the picture file information go?
"Jay B. Harlow [MVP - Outlook]" wrote:
Ron,
In addition to (instead of) handling the Paint event as Kevin showed, I
would consider overriding the OnPaintBackground method, as the
OnPaintBackground is the method that paints the background.

Something like:

Protected Overrides Sub OnPaintBackground(ByVal e As PaintEventArgs)
If Me.BackgroundImage Is Nothing Then Exit Sub
e.Graphics.DrawImage(Me.BackgroundImage, Me.ClientRectangle)
End Sub

NOTE: You do not want (or need) to call MyBase.OnPaintBackground as you
are
painting the entire background.

http://msdn.microsoft.com/library/de...roundtopic.asp

The following articles discusses the OnPaintBackground method:
http://msdn.microsoft.com/library/de...rmscontrol.asp

Hope this helps
Jay

"Ron Holmes" <vb**********@noemail.nospam> wrote in message
news:A2**********************************@microsof t.com...
> Hi,
> Thank you for your reply. Yes, you have a complete understanding of my
> problem. I am a visual basic programmer and will have to study your C#
> code
> closely to see if I can glean a vb method to accomplish importing my
> image
> file using the OnPaint event. Thank you again for your response. Are
> you
> able
> to provide an example of this procedure in visual basic code? Thanks
> again.
>
> "Kevin Yu [MSFT]" wrote:
>
>> Hi,
>>
>> First of all, I would like to confirm my understanding of your issue.
>> From
>> your description, I understand that you need the background image size
>> to
>> be the same as client rectangle by stretching instead of tiling. If
>> there
>> is any misunderstanding, please feel free to let me know.
>>
>> As far as I know, this cannot be implemented so simply as in VB6. We
>> can
>> try to override the OnPaint event to achieve this. When painting, we
>> just
>> use Graphics.DrawImage to draw the particular bitmap to the client
>> area.
>> Here is an example:
>>
>> private void Form1_Paint(object sender,
>> System.Windows.Forms.PaintEventArgs e)
>> {
>> Bitmap b = new Bitmap(@"D:\My Documents\My Pictures\untitled.bmp");
>> e.Graphics.DrawImage(b,
>> this.ClientRectangle.X,this.ClientRectangle.Y,this .ClientRectangle.Width,
>> this.ClientRectangle.Height);
>> }
>>
>> HTH.
>>
>> Kevin Yu
>> =======
>> "This posting is provided "AS IS" with no warranties, and confers no
>> rights."
>>
>>


Jul 21 '05 #8
You're welcome. Thanks for sharing your experience with all the people
here. If you have any questions, please feel free to post them in the
community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jim Hubbard | last post by:
By true tiling I do not mean the Vertical tiling or horizontal tiling like .... 1 2 3 4 or
9
by: Rajat Tandon | last post by:
Hello there, I am relatively new to the newsgroups and C#. I have never been disappointed with the groups and always got the prompt replies to my queries.This is yet another strange issue, I am...
10
by: Tyrant Mikey | last post by:
I don't know if this can even be done, but I'd REALLY like to eliminate the selection rectangle that appears around my ImageButton controls when the user clicks on them. The buttons are on a black...
8
by: Ron Holmes | last post by:
I want to place a background image on a windows form. Is there a way to prevent the image from Tiling without using an image box resized to the size of the form? I am using Visual Studio 2003...
3
by: Sridhar | last post by:
Hi, I have created a user control which has the html code as follows <TABLE id="ToolBarTable" cellSpacing="0" cellPadding="0" width="100%" border="0"> <tr> <td align="right"...
3
by: Viken Karaguesian | last post by:
Hello all, I need somehelp with background tiling. I have a sneaking suspicion that what I want to do is not possible, but I'll ask anyway. :>) First some background: Here's the site in...
2
by: Frankie | last post by:
Using SQL Server 2005 and .NET 2.0; I'm creating a Windows Forms application that will need to display photos of people, along with a bunch of information about each person. In a Web...
5
by: ankit1999 | last post by:
I have a problem, everytime i'm run this page http://click2travel.in/index.php i get the this error,,,
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.