Solved

Can I SavePicture with > 256 colors in VB3??

Posted on 1998-05-01
5
241 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now