PC Review


Reply
Thread Tools Rate Thread

Bitmap questions

 
 
=?Utf-8?B?Sm9obg==?=
Guest
Posts: n/a
 
      31st Aug 2006
I don't like the following way to create a bitmap.
Bitmap bm = new Bitmap("C:\\MyBitmap.bmp");

Can I create a bitmap from the bitmap in a picturebox?

Thanks.
 
Reply With Quote
 
 
 
 
Andy Bates
Guest
Posts: n/a
 
      1st Sep 2006
Several ways to create a bitmap (or any other image for that matter).

Image i = Image.FromFile("filename.jpg");
i.Save("filename.bmp");

The picturebox has a property called Image which is the internal image
class.

You can call the same methods on that to manipulate it.

- Andy

"John" <(E-Mail Removed)> wrote in message
news7089703-063E-47E7-8A36-(E-Mail Removed)...
>I don't like the following way to create a bitmap.
> Bitmap bm = new Bitmap("C:\\MyBitmap.bmp");
>
> Can I create a bitmap from the bitmap in a picturebox?
>
> Thanks.



 
Reply With Quote
 
Bob Powell [MVP]
Guest
Posts: n/a
 
      1st Sep 2006
You have to put the bitmap into the PictureBox to display it, why create
another one from it?

Perhaps you're thinking of doing something like:

Graphics g=myPictureBox.CreateGraphics();
g.DrawStuff
Bitmap b=myPictureBox.Image;

In which case you are labouring under a pile of misaprehension and should
probably go read the GDI+ FAQ.

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

Ramuseco Limited .NET consulting
http://www.ramuseco.com

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.



"John" <(E-Mail Removed)> wrote in message
news7089703-063E-47E7-8A36-(E-Mail Removed)...
>I don't like the following way to create a bitmap.
> Bitmap bm = new Bitmap("C:\\MyBitmap.bmp");
>
> Can I create a bitmap from the bitmap in a picturebox?
>
> Thanks.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Questions about Bitmap class Danny Ni Microsoft C# .NET 1 27th Feb 2009 05:25 AM
Bitmap questions Vortex Microsoft Dot NET Compact Framework 2 25th Jul 2005 08:49 PM
Questions about resxgen, resgen, resedit and bitmap image resource =?Utf-8?B?Smlt?= Microsoft Dot NET Framework 1 15th Jul 2004 12:57 AM
Questions about resxgen, resgen, resedit and bitmap image resource =?Utf-8?B?Smlt?= Microsoft Dot NET Framework 0 14th Jul 2004 11:08 PM
Question on how to access bitmap: Public Function getBitmap() As Bitmap Michael Murphy Microsoft VB .NET 2 7th Oct 2003 01:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:16 AM.