Solved

Can I SavePicture with > 256 colors in VB3??

Posted on 1998-05-01
5
239 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Zsi,
 Thanks. I suspected this.
MinnEE
 
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

772 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

9 Experts available now in Live!

Get 1:1 Help Now