![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Saving Images ... I have a Metafile that I would like to save as an image. So far, this seems to work fine: Metafile x = new Metafile(myFilename); x.Save(jpgFilename, ImageFormat.Jpeg); While I get the image fine, the background is black. For the life of me, I can't figure out how to make the background white. Any ideas? Somebody please make me feel stupid. Thanks. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Saving Images ... "Peter Duniho" <NpOeStPeAdM@xxxxxx> wrote in message news p.ukv6efrt8jd0ej@xxxxxx-computer.local...Quote: > On Wed, 19 Nov 2008 16:00:24 -0800, Tom <johnthompson1@xxxxxx> wrote: > Quote: >> I have a Metafile that I would like to save as an image. So far, this >> seems to work fine: >> >> Metafile x = new Metafile(myFilename); >> x.Save(jpgFilename, ImageFormat.Jpeg); >> >> While I get the image fine, the background is black. For the life of >> me, I can't figure out how to make the background white. Any ideas? > Black is the color of default-initialized pixels (0 for all components). > You have two options: modify the metafile so that it explicitly fills a > white background behind itself, or draw the metafile into a Bitmap > instance you've cleared to white and save the Bitmap instead of the > metafile. > > Pete Bitmap), but I can't find any example code anywhere to get me started. How would I draw the Metafile object into a Bitmap object that has been cleared to a white background? Thanks again. |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Saving Images ... On Wed, 19 Nov 2008 17:05:45 -0800, Tom <johnthompson1@xxxxxx> wrote: Quote: > Thank you Pete. I'm up for either of those 2 options (probably prefer > the Bitmap), but I can't find any example code anywhere to get me > started. How would I draw the Metafile object into a Bitmap object that > has been cleared to a white background? destination Bitmap, call Graphics.FromImage(), then draw whatever you want with that Graphics instance (see Graphics.Clear() and Graphics.DrawImage() for inspiration). Don't forget to dispose your IDisposables. ![]() Pete |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Saving Images ... "Peter Duniho" <NpOeStPeAdM@xxxxxx> wrote in message news p.ukv8dqai8jd0ej@xxxxxx-computer.local...Quote: > On Wed, 19 Nov 2008 17:05:45 -0800, Tom <johnthompson1@xxxxxx> wrote: > Quote: >> Thank you Pete. I'm up for either of those 2 options (probably prefer >> the Bitmap), but I can't find any example code anywhere to get me >> started. How would I draw the Metafile object into a Bitmap object that >> has been cleared to a white background? > See the Graphics and Bitmap classes. In particular, create your > destination Bitmap, call Graphics.FromImage(), then draw whatever you want > with that Graphics instance (see Graphics.Clear() and Graphics.DrawImage() > for inspiration). > > Don't forget to dispose your IDisposables. ![]() > > Pete |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Sounds Simple but very important; Trouble saving a webpage with images Offline. | Vista file management | |||
| Saving images from internet | Vista file management | |||
| Getty Images and View Images Can't view | Vista General | |||
| Saving Images, etc. | Vista music pictures video | |||
| Creating and saving Stationary with own images | Vista mail | |||