Groups | Blog | Home
all groups > dotnet drawing api > november 2004 >

dotnet drawing api : scale background image


Patrick
11/28/2004 5:55:01 PM
Hi Ng,

i have a background image on a panel. Now I want the image to be scaled to
the panel size. Is this possible? Can I also make the image transparent?

Thanks in advance and best regards,
Bob Powell [MVP]
11/29/2004 9:48:18 AM
Derive a new component from Panel and override the OnPaintBackground method.
Stretch the background image to suit.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





[quoted text, click to view]

Patrick
11/29/2004 8:47:05 PM
and how do I stretch the image? I cannot just set the size??

I still have my control resizing and property grid problem. I tried to
approach you via mail bob(at)bobpowell.net, but it seems that you didn't get
it. Can I ask you some questions regarding that?

Best regards
Patrick

"Bob Powell [MVP]" schrieb:

[quoted text, click to view]
Patrick
11/30/2004 1:43:02 AM
ok, the stretching works fine now...

"Bob Powell [MVP]" schrieb:

[quoted text, click to view]
Bob Powell [MVP]
11/30/2004 12:48:08 PM
Hi Patrick,
I did get your mail, along with 500 others that day. :-)

I only have time to reply to a few and then sometimes only after several
days.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





[quoted text, click to view]

AddThis Social Bookmark Button