Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4095
Number of posts: 14004

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Changing the SHOW_BMP Unit's resolution Posted by NinthAngle on 21 Jun 2006 at 10:44 AM
Ive managed to get you new unit running. Thanks. Now how do I change the resolution at which it displayes images. 320*300 (Which is what I think it runs at now) is not enough...

regards,
NA
Report
Re: Changing the SHOW_BMP Unit's resolution Posted by Phat Nat on 26 Jun 2006 at 6:32 PM
: Ive managed to get you new unit running. Thanks. Now how do I change the resolution at which it displayes images. 320*300 (Which is what I think it runs at now) is not enough...
:
: regards,
: NA
:

Just set the mode that you want. They are listed at the top of the unit. For example:
Graphix(Mode640x480x8);

will set the screen to 640x480 with 8bpp (256 colors)

You can load the info from the BMP first using GETBMPINFO and then figure out what mode you need based on that. Find the next largest screen size and set it. If your BMP is 700x500, then set the next size up (800x600) and whatever the BPP is set to as well if you need to.

Phat Nat


Report
Re: Changing the SHOW_BMP Unit's resolution Posted by NinthAngle on 27 Jun 2006 at 2:15 PM
: : Ive managed to get you new unit running. Thanks. Now how do I change the resolution at which it displayes images. 320*300 (Which is what I think it runs at now) is not enough...
: :
: : regards,
: : NA
: :
:
: Just set the mode that you want. They are listed at the top of the unit. For example:
:
: Graphix(Mode640x480x8);
: 

: will set the screen to 640x480 with 8bpp (256 colors)
:
: You can load the info from the BMP first using GETBMPINFO and then figure out what mode you need based on that. Find the next largest screen size and set it. If your BMP is 700x500, then set the next size up (800x600) and whatever the BPP is set to as well if you need to.
:
: Phat Nat
:
:
:

I tried tohe GETBMPINFO command, it didnt work... I know that my images are at a 300*300 resolution, which looks fine in windows but terrible in pascal.

Could it be that it isnt the resolution that is the problem but that pascal doesnt perhaps recognize my graphics card?

I changed the resolution in which pascal would display the image by modifying the Graphix command. All I got in the program were stripes on the screen... help?

thanks
NA

Report
Re: Changing the SHOW_BMP Unit's resolution Posted by Phat Nat on 27 Jun 2006 at 5:49 PM
: : : Ive managed to get you new unit running. Thanks. Now how do I change the resolution at which it displayes images. 320*300 (Which is what I think it runs at now) is not enough...
: : :
: : : regards,
: : : NA
: : :
: :
: : Just set the mode that you want. They are listed at the top of the unit. For example:
: :
: : Graphix(Mode640x480x8);
: : 

: : will set the screen to 640x480 with 8bpp (256 colors)
: :
: : You can load the info from the BMP first using GETBMPINFO and then figure out what mode you need based on that. Find the next largest screen size and set it. If your BMP is 700x500, then set the next size up (800x600) and whatever the BPP is set to as well if you need to.
: :
: : Phat Nat
: :
: :
: :
:
: I tried tohe GETBMPINFO command, it didnt work... I know that my images are at a 300*300 resolution, which looks fine in windows but terrible in pascal.
:
: Could it be that it isnt the resolution that is the problem but that pascal doesnt perhaps recognize my graphics card?
:
: I changed the resolution in which pascal would display the image by modifying the Graphix command. All I got in the program were stripes on the screen... help?
:
: thanks
: NA

I built the unit myself, so I'm sure there are problems in it. It will display basic stuff. What color depth are your pictures saved in and what mode are you trying to use to display them. I'm sure it probably has faults with 16 color pictures (4bpp), but depending on the mode that they are saved in and the mode you are displaying I don't know.

Anyways, post the picture color depth and the mode you are trying to use or try using a different mode (such as 640x480x8 instead of 640x480x24 or vise-versa)

You can get the BMPInfo and display it like so:
UNIT Show_BMP;
VAR
   BMPInfo : InfoBlock;

Begin
     GetBMPInfo('C:\MYPHOTO.BMP',BMPInfo);
     ShowBMPInfo(BMPInfo);
End.


Note that my unit doesn't check for compression in the files. If they use compression, it will not display them properly. With the info asked for above, it would help to have the SHOWBMPINFO listing as well.

Phat Nat

Report
Re: Changing the SHOW_BMP Unit's resolution Posted by NinthAngle on 28 Jun 2006 at 6:49 AM
: : : : Ive managed to get you new unit running. Thanks. Now how do I change the resolution at which it displayes images. 320*300 (Which is what I think it runs at now) is not enough...
: : : :
: : : : regards,
: : : : NA
: : : :
: : :
: : : Just set the mode that you want. They are listed at the top of the unit. For example:
: : :
: : : Graphix(Mode640x480x8);
: : : 

: : : will set the screen to 640x480 with 8bpp (256 colors)
: : :
: : : You can load the info from the BMP first using GETBMPINFO and then figure out what mode you need based on that. Find the next largest screen size and set it. If your BMP is 700x500, then set the next size up (800x600) and whatever the BPP is set to as well if you need to.
: : :
: : : Phat Nat
: : :
: : :
: : :
: :
: : I tried tohe GETBMPINFO command, it didnt work... I know that my images are at a 300*300 resolution, which looks fine in windows but terrible in pascal.
: :
: : Could it be that it isnt the resolution that is the problem but that pascal doesnt perhaps recognize my graphics card?
: :
: : I changed the resolution in which pascal would display the image by modifying the Graphix command. All I got in the program were stripes on the screen... help?
: :
: : thanks
: : NA
:
: I built the unit myself, so I'm sure there are problems in it. It will display basic stuff. What color depth are your pictures saved in and what mode are you trying to use to display them. I'm sure it probably has faults with 16 color pictures (4bpp), but depending on the mode that they are saved in and the mode you are displaying I don't know.
:
: Anyways, post the picture color depth and the mode you are trying to use or try using a different mode (such as 640x480x8 instead of 640x480x24 or vise-versa)
:
: You can get the BMPInfo and display it like so:
:
: UNIT Show_BMP;
: VAR
:    BMPInfo : InfoBlock;
: 
: Begin
:      GetBMPInfo('C:\MYPHOTO.BMP',BMPInfo);
:      ShowBMPInfo(BMPInfo);
: End.
: 

:
: Note that my unit doesn't check for compression in the files. If they use compression, it will not display them properly. With the info asked for above, it would help to have the SHOWBMPINFO listing as well.
:
: Phat Nat
:
:


I copied the code you posted, the one designed to tell me which mode I am in, into notepad and saved it as a pas file. I then added the PROGRAM command, but it wouldnt compile...
Report
Re: Changing the SHOW_BMP Unit's resolution Posted by zibadian on 28 Jun 2006 at 6:51 AM
: : : : : Ive managed to get you new unit running. Thanks. Now how do I change the resolution at which it displayes images. 320*300 (Which is what I think it runs at now) is not enough...
: : : : :
: : : : : regards,
: : : : : NA
: : : : :
: : : :
: : : : Just set the mode that you want. They are listed at the top of the unit. For example:
: : : :
: : : : Graphix(Mode640x480x8);
: : : : 

: : : : will set the screen to 640x480 with 8bpp (256 colors)
: : : :
: : : : You can load the info from the BMP first using GETBMPINFO and then figure out what mode you need based on that. Find the next largest screen size and set it. If your BMP is 700x500, then set the next size up (800x600) and whatever the BPP is set to as well if you need to.
: : : :
: : : : Phat Nat
: : : :
: : : :
: : : :
: : :
: : : I tried tohe GETBMPINFO command, it didnt work... I know that my images are at a 300*300 resolution, which looks fine in windows but terrible in pascal.
: : :
: : : Could it be that it isnt the resolution that is the problem but that pascal doesnt perhaps recognize my graphics card?
: : :
: : : I changed the resolution in which pascal would display the image by modifying the Graphix command. All I got in the program were stripes on the screen... help?
: : :
: : : thanks
: : : NA
: :
: : I built the unit myself, so I'm sure there are problems in it. It will display basic stuff. What color depth are your pictures saved in and what mode are you trying to use to display them. I'm sure it probably has faults with 16 color pictures (4bpp), but depending on the mode that they are saved in and the mode you are displaying I don't know.
: :
: : Anyways, post the picture color depth and the mode you are trying to use or try using a different mode (such as 640x480x8 instead of 640x480x24 or vise-versa)
: :
: : You can get the BMPInfo and display it like so:
: :
: : UNIT Show_BMP;
: : VAR
: :    BMPInfo : InfoBlock;
: : 
: : Begin
: :      GetBMPInfo('C:\MYPHOTO.BMP',BMPInfo);
: :      ShowBMPInfo(BMPInfo);
: : End.
: : 

: :
: : Note that my unit doesn't check for compression in the files. If they use compression, it will not display them properly. With the info asked for above, it would help to have the SHOWBMPINFO listing as well.
: :
: : Phat Nat
: :
: :
:
:
: I copied the code you posted, the one designed to tell me which mode I am in, into notepad and saved it as a pas file. I then added the PROGRAM command, but it wouldnt compile...
:
Notepad probably added a .txt extention to it. Or you have given it a non-DOS filename.
Report
Re: Changing the SHOW_BMP Unit's resolution Posted by Phat Nat on 28 Jun 2006 at 5:58 PM
: : You can get the BMPInfo and display it like so:
: :
: : UNIT Show_BMP;
: : VAR
: :    BMPInfo : InfoBlock;
: : 
: : Begin
: :      GetBMPInfo('C:\MYPHOTO.BMP',BMPInfo);
: :      ShowBMPInfo(BMPInfo);
: : End.
: : 

: :
: : Note that my unit doesn't check for compression in the files. If they use compression, it will not display them properly. With the info asked for above, it would help to have the SHOWBMPINFO listing as well.
: :
: : Phat Nat
: :
: I copied the code you posted, the one designed to tell me which mode I am in, into notepad and saved it as a pas file. I then added the PROGRAM command, but it wouldnt compile...
:

My mistake. It should be USES Show_BMP, not UNIT Show_BMP.
Also, you didn't post what mode you were trying to use or what color depth your BMPs are.

Phat Nat

Report
Re: Changing the SHOW_BMP Unit's resolution Posted by NinthAngle on 1 Jul 2006 at 6:30 PM
: : : You can get the BMPInfo and display it like so:
: : :
: : : UNIT Show_BMP;
: : : VAR
: : :    BMPInfo : InfoBlock;
: : : 
: : : Begin
: : :      GetBMPInfo('C:\MYPHOTO.BMP',BMPInfo);
: : :      ShowBMPInfo(BMPInfo);
: : : End.
: : : 

: : :
: : : Note that my unit doesn't check for compression in the files. If they use compression, it will not display them properly. With the info asked for above, it would help to have the SHOWBMPINFO listing as well.
: : :
: : : Phat Nat
: : :
: : I copied the code you posted, the one designed to tell me which mode I am in, into notepad and saved it as a pas file. I then added the PROGRAM command, but it wouldnt compile...
: :
:
: My mistake. It should be USES Show_BMP, not UNIT Show_BMP.
: Also, you didn't post what mode you were trying to use or what color depth your BMPs are.
:
: Phat Nat
:
:
'

I set pascal (the Graphix command) to use 640x480x8. The color depth is 24 bit...

im not sure I understand what the code you posted is supposed to tell me.

The thing that gets me is that regardless of what resolution I have set the program to display the images, I still (if I display the pictures in 320x200x8) get a picture that looks not as good when I look at it in windows normally (bearing in mind that the image is saved to 300x300)

I tried playing around with the resolutions.

320x200x8 works but doesnt look good enough
320x200x15 doesnt display any images (only text)
320x200x16 doesnt display any images (only text)
320x200x24 doesnt display any images (only text)
640x480x8 displayes images in fragments
640x480x1 displayes nothing but a purple cursor
640x480x4 displayes nothing but a purple cursor
640x480x15 doesnt display any images (only text)
640x480x16 fragmented images
640x480x24 fragmented images

800x600x4 doesnt display any images (purple text only)
800x600x8 black screen
800x600x15 only text
800x600x16 black screen
800x600x24 fragmented images


1024x768x4 didnt test,assume they wont work either.
1024x768x8
1024x768x15
1024x768x16
1024x768x24

1280x1024x4
1280x1024x8
1280x1024x15
1280x1024x16
1280x1024x24

Heres what the SHOWBMP told me:


Size = 270054
Bitmappoffset = 54
Type = 40
Width = 300
Height = 300
Bits = 24
Planes = 1
Filesize = 2700000
Realsize = 90000
XpelsPerMet = 2834
YPelsPelMet = 2834
Color Used = 0
Color Imp = 0

Is it the graphics card or is it the program?
Report
Re: Changing the SHOW_BMP Unit's resolution Posted by Phat Nat on 5 Jul 2006 at 10:09 PM
: I set pascal (the Graphix command) to use 640x480x8. The color depth is 24 bit...
:
: im not sure I understand what the code you posted is supposed to tell me.
:
: The thing that gets me is that regardless of what resolution I have set the program to display the images, I still (if I display the pictures in 320x200x8) get a picture that looks not as good when I look at it in windows normally (bearing in mind that the image is saved to 300x300)
:
: I tried playing around with the resolutions.
:
: 320x200x8 works but doesnt look good enough
: 320x200x15 doesnt display any images (only text)
: 320x200x16 doesnt display any images (only text)
: 320x200x24 doesnt display any images (only text)
: 640x480x8 displayes images in fragments
: 640x480x1 displayes nothing but a purple cursor
: 640x480x4 displayes nothing but a purple cursor
: 640x480x15 doesnt display any images (only text)
: 640x480x16 fragmented images
: 640x480x24 fragmented images
:
: 800x600x4 doesnt display any images (purple text only)
: 800x600x8 black screen
: 800x600x15 only text
: 800x600x16 black screen
: 800x600x24 fragmented images
:
:
: 1024x768x4 didnt test,assume they wont work either.
: 1024x768x8
: 1024x768x15
: 1024x768x16
: 1024x768x24
:
: 1280x1024x4
: 1280x1024x8
: 1280x1024x15
: 1280x1024x16
: 1280x1024x24
:
: Heres what the SHOWBMP told me:
:
:
: Size = 270054
: Bitmappoffset = 54
: Type = 40
: Width = 300
: Height = 300
: Bits = 24
: Planes = 1
: Filesize = 2700000
: Realsize = 90000
: XpelsPerMet = 2834
: YPelsPelMet = 2834
: Color Used = 0
: Color Imp = 0
:
: Is it the graphics card or is it the program?

I made a 300x300 (24-bit) BMP and managed to display it in 640x480x8 and 640x480x24. Although it doesn't properly use the higher resolutions. This may be something to do with running it through windows or just improper support for older programs, etc.

If it's scrambled and constantly moving, then that resoution's frequency is too high for your monitor. Either way, the program just utilizes VESA modes, so if your card/monitor don't support VESA properly, then it will have problems. That is why I have preferred to stick with good ol' Mode 13h (320x200x256).
As for your images not looking as good, it's because in windows your image is only displayed on a small part of the screen, but in dos it uses the whole screen and so each pixel is magnified and makes the image appear blocky. There are ways of making a small image look better, but that takes a higher resolution and some image manipulation.

There are procedures that will tell you what VESA modes are properly supported, but I haven't incorporated them into the program. Unfortunately, DOS is a <dying> operating system. Somethings aren't being made as backwards compatible anymore.

You could try using a different method of setting the video modes (BGI might work?) and then use the unit to try and display the BMPs onto the existing screen. Otherwise, you may want to look up information on VESA and try to learn more about it. Maybe you could improve on the video modes.

Phat Nat

Report
Re: Changing the SHOW_BMP Unit's resolution Posted by NinthAngle on 20 Jul 2006 at 11:28 AM
: : I set pascal (the Graphix command) to use 640x480x8. The color depth is 24 bit...
: :
: : im not sure I understand what the code you posted is supposed to tell me.
: :
: : The thing that gets me is that regardless of what resolution I have set the program to display the images, I still (if I display the pictures in 320x200x8) get a picture that looks not as good when I look at it in windows normally (bearing in mind that the image is saved to 300x300)
: :
: : I tried playing around with the resolutions.
: :
: : 320x200x8 works but doesnt look good enough
: : 320x200x15 doesnt display any images (only text)
: : 320x200x16 doesnt display any images (only text)
: : 320x200x24 doesnt display any images (only text)
: : 640x480x8 displayes images in fragments
: : 640x480x1 displayes nothing but a purple cursor
: : 640x480x4 displayes nothing but a purple cursor
: : 640x480x15 doesnt display any images (only text)
: : 640x480x16 fragmented images
: : 640x480x24 fragmented images
: :
: : 800x600x4 doesnt display any images (purple text only)
: : 800x600x8 black screen
: : 800x600x15 only text
: : 800x600x16 black screen
: : 800x600x24 fragmented images
: :
: :
: : 1024x768x4 didnt test,assume they wont work either.
: : 1024x768x8
: : 1024x768x15
: : 1024x768x16
: : 1024x768x24
: :
: : 1280x1024x4
: : 1280x1024x8
: : 1280x1024x15
: : 1280x1024x16
: : 1280x1024x24
: :
: : Heres what the SHOWBMP told me:
: :
: :
: : Size = 270054
: : Bitmappoffset = 54
: : Type = 40
: : Width = 300
: : Height = 300
: : Bits = 24
: : Planes = 1
: : Filesize = 2700000
: : Realsize = 90000
: : XpelsPerMet = 2834
: : YPelsPelMet = 2834
: : Color Used = 0
: : Color Imp = 0
: :
: : Is it the graphics card or is it the program?
:
: I made a 300x300 (24-bit) BMP and managed to display it in 640x480x8 and 640x480x24. Although it doesn't properly use the higher resolutions. This may be something to do with running it through windows or just improper support for older programs, etc.
:
: If it's scrambled and constantly moving, then that resoution's frequency is too high for your monitor. Either way, the program just utilizes VESA modes, so if your card/monitor don't support VESA properly, then it will have problems. That is why I have preferred to stick with good ol' Mode 13h (320x200x256).
: As for your images not looking as good, it's because in windows your image is only displayed on a small part of the screen, but in dos it uses the whole screen and so each pixel is magnified and makes the image appear blocky. There are ways of making a small image look better, but that takes a higher resolution and some image manipulation.
:
: There are procedures that will tell you what VESA modes are properly supported, but I haven't incorporated them into the program. Unfortunately, DOS is a <dying> operating system. Somethings aren't being made as backwards compatible anymore.
:
: You could try using a different method of setting the video modes (BGI might work?) and then use the unit to try and display the BMPs onto the existing screen. Otherwise, you may want to look up information on VESA and try to learn more about it. Maybe you could improve on the video modes.
:
: Phat Nat
:
:


I also manage to run the thing in 640x480x24 on my laptop. However, it doesnt display in full screen. Is this something I can remedy by looking into the information you provided in you last post or is there a simpler way?
Report
Re: Changing the SHOW_BMP Unit's resolution Posted by Phat Nat on 20 Jul 2006 at 9:19 PM
:
: I also manage to run the thing in 640x480x24 on my laptop. However, it doesnt display in full screen. Is this something I can remedy by looking into the information you provided in you last post or is there a simpler way?
:

Unfortunately, 300x300 isn't a standard screen size, so there is no easy way to display it full screen. You would either have to try to create your own Video Mode that is 300x300 or use mathematical calculations to resize your image accordingly. Neither is easy. the third method is to use Paint/Photoshop/etc to resize the images to 640x480 nad then display them as so.

Phat Nat




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.