answersLogoWhite

0

unsigned char far *VIDEO = (char far *)0xa0000000l;<br>

// pointer to video memory<br>

// to plot pixel-> VIDEO[y*320+x]=color; |or| VIDEO[(y<<8)+(y<<6)+x]=color;<br>

// the 2 bit shifts should be faster<p>

so simply load your image into a segment of memory<br>

and use:<p>

memcpy(*VIDEO, *IMAGE, x) //where x is the number of BYTES to copy<p>

to load a RAW image (RAW file format)<br>

<br>

FILE *in;<p>

if ((in = fopen("image.raw", "rb")) == NULL)<br>

{<br>

printf("Ooops cannot open file :(\n", filename);<br>

exit(1);<br>

}<br>

fseek(in, 18, SEEK_SET); //skip header<br>

fread(palette, 768, 1, in); //load palette<br>

fread(IMAGE, width*height, 1, in); //load image<br>

fclose(in); //65536<p>

you sould now change your palette to match by using your favorite<br>

palette set routine<p>

remember: to write to video you must me in video mode!!!<p>

_AX=0x13; //load 13hex (19 dec) into register AX<br>

geninterrupt(0x10); //put register ax into interrupt 0x10 (video int)<p>

and use _AX=0x03; to set text mode<p>

create an array for palette<br>

char palette[768]; // (256*3 [one for RGB])<p>

<br>

change it then copy your palette to video:<p>

<br>

outp(0x3c8,0);<br>

for (i = 0; i < 256; i++)<br>

{<br>

outp(0x3c9, palette[i*3+2]);<br>

outp(0x3c9, palette[i*3+1]);<br>

outp(0x3c9, palette[i*3+0]);<br>

}<p>

<br>

This covers the basics for displaying images. However, to load a JPEG file requires that you either research the JPEG file format and write your own code or use a JPEG library (which you may have to compile with TC3). There are many free JPEG libraries available, and free libraries for other graphical formats including BMP, PNG, TIFF and TGA.

If you wish to write your own JPEG handling functions, see the related links below for technical details about this image file format.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What are some common questions related to the JPEG image format?

Some common questions related to the JPEG image format include: What is JPEG? How does JPEG compression work? What are the advantages and disadvantages of using JPEG? How can I convert a JPEG image to a different file format?


Why the image not come sometime in HTML?

sometimes if the system does not support image formats like GIF,JPEG,PNG... then the HTML will not display the image.and also if the image is developed using flash player then system must support flash player. sometimes if the location of image source is not correct means then image will not display.


What exactly does JPEG stand for when you save a file image?

A JPEG is a format that an image file can be saved as. The acronym JPEG stands for Joint Photographic Experts Group. This was the development group for 24-bit colour image storage.


Which file format is better for image quality and editing: TIFF or JPEG?

TIFF is better for image quality and editing compared to JPEG.


Which file format is better for preserving image quality: JPEG or TIFF?

TIFF is better for preserving image quality compared to JPEG.


How do you turn an JPEG image into a jpg image?

JPEG is the same as JPG. However if you really want to rename your .jpeg images into .jpg, you can go to Command Prompt, navigate to the folder of where your pictures are stored, and type in: ren *.jpeg *.jpg


What are the differences between saving an image as a JPEG 100 and a JPEG 20 in terms of quality and file size?

When saving an image as a JPEG 100, the quality is higher and the file size is larger compared to saving it as a JPEG 20. JPEG 100 will have less compression and therefore better image quality, but it will result in a larger file size. On the other hand, JPEG 20 will have more compression, leading to lower image quality but a smaller file size.


What is the maximum file size for a JPEG image to be considered a high-quality image?

The maximum file size for a high-quality JPEG image is typically around 10-12 megabytes.


A JPG is what file type on a computer?

A jpg otherwise known as jpeg is an image file. When you save an image from the internet .jpg or .jpeg is the default save extension.


Do JPEG images lose minor image details?

Generally yes, the JPEG algorithm uses a lossy compression, so minor image details are lost. For more details about the JPEG algorithm visit the related link.


What are the benefits of saving an image in the JPEG Fine format?

Saving an image in the JPEG Fine format offers benefits such as high image quality, smaller file size, and compatibility with most devices and software.


Can you retrieve a JPEG file out of a HTML file?

A .jpeg file is not in an HTML file. It is a separate file that is called from the HTML file to display on the browser. You can get the URL of the jpeg file from the HTML file and if the graphic is still there, the file can be obtained from its location. If you are on the actual web page that displays the image, you can usually right click on the image and select 'Save As' and save the file. Some web sites have their images protected to prevent you from saving their photos onto your harddrive.