small bmp image problem
Posted: Wed Oct 22, 2008 3:35 am
hi there,
I've developed my os for quite a while and recently decided to work a little on the GUI before continuing further. I've setup a vesa mode (1024x768x32) and can draw text and stuff, however I'm kind of stuck at this one problem, I try drawing 24 bit bitmaps but the output the image is like 1/4th of the original size.
Uncommenting the commented code, I get the original image dimensions, however the image quality goes down cos I stretch the image.
I've attached a picture of the output I get when I try to draw a background image.
This is the code I use to draw the image
Could you tell me what i'm doing wrong here, I cant seem to figure it out.
Thanks,
Sanchan M
I've developed my os for quite a while and recently decided to work a little on the GUI before continuing further. I've setup a vesa mode (1024x768x32) and can draw text and stuff, however I'm kind of stuck at this one problem, I try drawing 24 bit bitmaps but the output the image is like 1/4th of the original size.
Uncommenting the commented code, I get the original image dimensions, however the image quality goes down cos I stretch the image.
I've attached a picture of the output I get when I try to draw a background image.
This is the code I use to draw the image
Code: Select all
y=y/3;
for(i=0;i<x;i++)
{
for(j=0;j<y;j++)
{
rgb = (u32)*pbmp;
rgb = (rgb | 0xff000000);
pbmp += 3;
*pAddr = (u32)rgb;
pAddr += 1;
//*pAddr = (u32)rgb;
//pAddr += 1;
//*pAddr = (u32)rgb;
//pAddr += 1;
//*pAddr = (u32)rgb;
//pAddr += 1;
}
}
Thanks,
Sanchan M