Solved

How do I open a *.PCX file with VB

Posted on 1998-12-28
13
395 Views
Last Modified: 2012-06-21
Does anyone know how I can open a PCX file using VB?
0
Comment
Question by:Steve2
[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
  • 7
  • 2
  • 2
  • +2
13 Comments
 
LVL 2

Expert Comment

by:polygon
ID: 1452728
you must either find a control to do so, or you must make your own algorithm to do it. You must then know the format PCX files are stored and read then in binary mode.
The PCX file starts with some 128 bytes of info, then the actual pixels and at the end - 768 bytes difining the 256 colors used. Just search the internet for detailed description as I don't want to write it all here.
0
 

Author Comment

by:Steve2
ID: 1452729
Thanks Polygon,

    I have been searching the internet, but I must be looking in all the wrong places because I can't seem to find any information. If anybody knows of anyplace I can either find these tools or information on the algorithim of the PCX file please let me know.

0
 
LVL 4

Expert Comment

by:idcanada
ID: 1452730

You will need to convert PCX to BMP before.
Have a look at http://www.total.net/~idc/
I will post a small sample their that will show you this process.


0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Steve2
ID: 1452731
The reason I'm trying to learn how to open this format is because of its space saving format. I've tried BMP's, but they start to take up WAYYY too much space after a few. A 44KB PCX file weighs in at about 62KB, I know this may not seem like much of a difference, but when you get a couple hundred rendered beleive me, you need as much space as possible. Thanks just the same though.
0
 

Author Comment

by:Steve2
ID: 1452732
Allow me to correct the spelling errors of my last comment.

The reason I'm trying to learn how to open a PCX file is because of it's small size in comparison to other image formats. I would do my program in BMP's but they begin to take up way too much space. A PCX file I've rendered is 44KB, but the BMP version of that rendering weighs in at about 62KB. Although this may not seem like a biug difference in size, when you have a couple hundred BMP's the size difference does become VERY noticeable. That is the reason for my question.
0
 

Author Comment

by:Steve2
ID: 1452733
Does anyone know of any FREE 3rd party OCX controls that can do this for me?
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1452734
Use JPG iso PCX. Much smaller. And viewable in VB
0
 
LVL 4

Accepted Solution

by:
chabaud earned 200 total points
ID: 1452735
Use GIF for 256 colors looseless compressed bitmap
or JPEG for photo bitmap.

This format can be open directly with VB from VB5 (see the Picture property or the LoadPicture() function).


0
 

Author Comment

by:Steve2
ID: 1452736
Yeah thanks, I figured it out a little bit ago myself. I was jsut waiting for someone to answer it because I couldn't figure out how to delete it, good answer!
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1452737
Steve2: Please don't accept answers that has been listed as comments before. If you want to remove a question tell an expert to answer the question.
Chabaud: I already told steve2 to use JPG iso GIF. Please don't answer using another person's comment
0
 
LVL 4

Expert Comment

by:chabaud
ID: 1452738
Sorry mirkwood my "new" answer was for GIF (that don't appear upper).
0
 

Author Comment

by:Steve2
ID: 1452739
Sorry Chabaud I was trying to figure out if there was a way to give points for a comment but I guess there isn't. So I figured it would've been best to delete it, but I didn't know how to go about doing that unless someone answered it. I don't use this Experts Exchange program very much. Once again I apologize and will try not to let it happen in the future.
0
 

Author Comment

by:Steve2
ID: 1452740
I also apologize to you too Mirkwood, I was aware of our comment and it was very helpful, I had just figured it out a day in advance to your comment, and was in the process of figuring out how to delete the question without having an answer, but apparently was unsuccessful.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

707 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