Posted By: Joozey
bmap_blitpart odd behaviour - 12/03/08 22:30
The case:
I want to grab a 16x16 part of a 128x32 BMP file, from the top left corner. No scaling, just cutting out the number 1, as seen in the image below.
Original image:
The result:
The result is scaled in y direction for no apparent reason. There's nothing wrong with the X direction. If the source image would have been 128 pixels in length, then the cut-out image is a full scale to the destination bitmap length, in y direction only.
I can't think of anything but that this is a bug. I tested it with tga and jpg files, same results. I used NULL instead of vector(), and tried to alter every value, but everything else seem to work fine.
I can't imagine that this is a problem caused by my code. But if it turns out to be so, then I apologise for this thread.
Kind regards,
Joozey
Code:
BMAP* sprite = bmap_createblack(16, 16, 24); BMAP* spriteset = bmap_create("test.bmp"); bmap_blitpart(sprite, spriteset, vector(0, 0, 0), vector(16, 16, 0), vector(0, 0, 0), vector(16, 16, 0));
I want to grab a 16x16 part of a 128x32 BMP file, from the top left corner. No scaling, just cutting out the number 1, as seen in the image below.
Original image:
The result:
The result is scaled in y direction for no apparent reason. There's nothing wrong with the X direction. If the source image would have been 128 pixels in length, then the cut-out image is a full scale to the destination bitmap length, in y direction only.
I can't think of anything but that this is a bug. I tested it with tga and jpg files, same results. I used NULL instead of vector(), and tried to alter every value, but everything else seem to work fine.
I can't imagine that this is a problem caused by my code. But if it turns out to be so, then I apologise for this thread.
Kind regards,
Joozey