Solved

Saving the contents of a picturebox to a Bitmap file

Posted on 1998-07-25
5
339 Views
Last Modified: 2010-05-03
How can I save the contents of a Picturebox at runtime into a bitmap file . I am using Visual basic 5.0 Enterprise Edition
0
Comment
Question by:abhimishra
  • 3
5 Comments
 

Author Comment

by:abhimishra
ID: 1466660
Someone please help me , I reaaly need this answer badly .
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1466661
Use SavePicture:
SavePicture Picture1.Picture, "C:\1.bmp"
0
 

Author Comment

by:abhimishra
ID: 1466662
I need to create thumbnails , so I am using the BITBLT API
call to create a reduced version of the image , the problem is
that when i transfer the scaled down version into a second picturebox
( which is to act as the thumbnail , and is small in size) ;
savepicture does not work on this BITBLTed image .
Is there any way to export the Clipboard to a file ... asuming the clipboard
contains BITMAP data
0
 
LVL 1

Accepted Solution

by:
cd74013 earned 200 total points
ID: 1466663
You can save the clipboard with:

if clipboard.getdata(vbCFBitmap) then ' save if it has a bitmap
    savepicture clipboard.getdata(vbCFBitmap),"filename"
    end if


I find it odd that you cannot use save picture on the second picture box directly.  Does it save a white picture, a zero length file or give an error?
0
 

Author Comment

by:abhimishra
ID: 1466664
Thankyou for your answer .
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question