Solved

Can I SavePicture with > 256 colors in VB3??

Posted on 1998-05-01
5
248 Views
Last Modified: 2012-05-04
When I try to use the SavePicture Statement when the monitor
is set to more than 256 bit colors, I get an error "out of memory". My complied programs have done the same on several of my users systems.  I can check the users monitor setup and tell them to change it if needed, but I would rather not. Do any one know if this is a basic limitation of VB3? Or is a way to handles this w/o asking the user to reset his monitor setup?
0
Comment
Question by:MinnEE
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 7

Expert Comment

by:kamall
ID: 1436695
MinnEE,
You can save the picture contained in a picture box (Picture1) using the following code:

Sub Command1_Click ()
        SavePicture Picture1.Image, "c:\myfile.bmp"
End Sub

This will save the picture to the file without any problems even in true color mode (16.7 million colors).
I have tested this code in the past on many machines with different color depths w/o problems.

Regards
0
 
LVL 1

Author Comment

by:MinnEE
ID: 1436696
The code you suggested is what I already tried, and I get the error message from VB. I even get it when running the single line of code in the debug window. When I change my monitor back to 256 colors, the problem goes away.  I have a 486 and Win3.1. My complied programs had the same problem on a NT system and another system of unknown version. Since then I have changed my program and quit testing other systems.  Perhaps there is a problem with my VB professional version.
0
 
LVL 1

Author Comment

by:MinnEE
ID: 1436697
On further testing, I do not get the error with 16.7 million colors (24 bit), but only with 65,536 colors (16 bit) in either screen resolutions of 480x640 or 600x800. With my monitor and others I have seen, 16.7 million colors is not available except in the lower resolution of 640x480
0
 
LVL 4

Accepted Solution

by:
zsi earned 100 total points
ID: 1436698
SavePicture does not support more than 256 colors in VB3.  You will basically have to use a third-party VBX like ImageKnife (or similar) or save the bitmap via the API and direct file access.

Save yourself a major headache and go with a VBX.

zsi
0
 
LVL 1

Author Comment

by:MinnEE
ID: 1436699
Zsi,
 Thanks. I suspected this.
MinnEE
 
0

Featured Post

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses
Course of the Month7 days, 2 hours left to enroll

623 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