Saving picturebox as a bit map image
Saving picturebox as a bit map image
Saving picturebox as a bit map image
Saving picturebox as a bit map image
Saving picturebox as a bit map image
Saving picturebox as a bit map image Saving picturebox as a bit map image Saving picturebox as a bit map image Saving picturebox as a bit map image Saving picturebox as a bit map image Saving picturebox as a bit map image Saving picturebox as a bit map image Saving picturebox as a bit map image
Saving picturebox as a bit map image Saving picturebox as a bit map image
Saving picturebox as a bit map image
Go Back  Xtreme Visual Basic Talk > > > Saving picturebox as a bit map image


Reply
 
Thread Tools Display Modes
  #1  
Old 12-21-2003, 06:26 AM
alex heino alex heino is offline
Newcomer
 
Join Date: Dec 2003
Posts: 2
Default Saving picturebox as a bit map image


I have problems with saving my picturebox to a bit map file.
I read another post in this forum and it was suggested that he
would set the autoredraw property of the picturebox to true.
So now my question is, where do i find this property?
I use VB .NET. Is the autoredraw only something that exsists in
the earlier versions of VB?
Reply With Quote
  #2  
Old 12-21-2003, 07:36 AM
reboot's Avatar
rebootSaving picturebox as a bit map image reboot is offline
Keeper of foo

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Graceland
Posts: 15,614
Default

PictureBox1.Image.Save("c:\newbitmap.bmp") works for me. Are you drawing on the bitmap yourself?
Reply With Quote
  #3  
Old 12-21-2003, 08:08 AM
alex heino alex heino is offline
Newcomer
 
Join Date: Dec 2003
Posts: 2
Default Tried it

The problem is not acctually saving.
I mean if i open a bitmap on to the picturebox it works fine.
I can also resave that picture.
The problem is im drawing onto the picturebox through a class, whitch uses picturebox1.creategrphics.
If i minimize the form after drawing something onto the picturebox, it has dissapered when i maximize the form again.

It seems as if i'm not acctually getting through to the picturebox control.
Reply With Quote
  #4  
Old 12-21-2003, 08:10 AM
reboot's Avatar
rebootSaving picturebox as a bit map image reboot is offline
Keeper of foo

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Graceland
Posts: 15,614
Default

Are you doing your drawing in the paint event?
Reply With Quote
  #5  
Old 12-21-2003, 10:28 AM
Csharp's Avatar
CsharpSaving picturebox as a bit map image Csharp is offline
Senior Contributor

* Expert *
 
Join Date: Jul 2003
Location: Ashby, Leicestershire.
Posts: 967
Default

if you dont carry out the drawing within the paint event of the picturebox, every time you minimize / something causes the picturebox to re-draw , you will lose whatever it is that was drawn.
a quick very basic example of where to carry out the drawing without losing it ...
Code:
Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint With e.Graphics .FillRectangle(New SolidBrush(Color.Red), e.ClipRectangle) .DrawString("some stuff", MyBase.Font, New SolidBrush(Color.Blue), 10, 10) End With End Sub
__________________
~~ please don't PM me regarding code, I only reply to personnal messages ~~
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Resizing an image in a PictureBox Nt3N Interface and Graphics 6 11-19-2003 03:49 AM
Saving Picturebox image as black & white (1-bit) bitmap file A-Dam Interface and Graphics 8 08-19-2003 11:54 PM
PUblic array With images NeverMore5 Game Programming 3 02-07-2003 01:59 PM
Saving a picturebox image zmanvortex General 10 10-09-2002 05:24 PM
Saving non image contents of a PictureBox nickmarshall General 2 06-25-2001 02:19 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Saving picturebox as a bit map image
Saving picturebox as a bit map image
Saving picturebox as a bit map image Saving picturebox as a bit map image
Saving picturebox as a bit map image
Saving picturebox as a bit map image
Saving picturebox as a bit map image Saving picturebox as a bit map image Saving picturebox as a bit map image Saving picturebox as a bit map image Saving picturebox as a bit map image Saving picturebox as a bit map image Saving picturebox as a bit map image
Saving picturebox as a bit map image
Saving picturebox as a bit map image
 
Saving picturebox as a bit map image
Saving picturebox as a bit map image
 
-->