You're code is not quite clear to me, but you may check what you've already done of these steps. here is some pseudocode:
Approach #1:
for each scanline in the original BMP
{
get the location of the file position indicator
repeat n times // resize vertically
{
if we're not at the beginning of therepeat currentn scanlinetimes
{
set theensure file position indicator backis at the beginning of thecurrent scanline
}
// resize horizontally
for each RGBTRIPLE in thiscurrent scanline
{
read an RGBTRIPLE
write thatcurrent RGBTRIPLE n times //to resizenew horizontallyBMP
}
write the new padding to the new BMP
}
skip theover old padding
}
Approach #2:
for each scanline in the original BMP
{
create anbig RGBTRIPLEsenough array named triples of size (original widthRGBTRIPLEs *named 2)triples
for each RGBTRIPLE in the current scanline
{
read an RGBTRIPLE
repeat n times // resize horizontally
{
storeappend thecurrent RGBTRIPLE into then currenttimes indexcontiguously ofto triples
}
}
// resize resize vertically
repeat n times
{
write thetriples (whole array into) theto new BMP
write the new padding to new BMP
}
skip the old padding
}
Hope that helps!