Solved

Can I SavePicture with > 256 colors in VB3??

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DIR issue 7 54
Adding to a VBA? 6 70
Looking for VB6 code to read SQL table export it to ascii 8 38
Protecting vb6 & .Net code Obfuscation 18 121
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

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