с DIB не работал ...
короче для одной фотки делал так
{320X240 -это истинный размер фото}
{Image2.Width := Trunc(Image2.Width * AspectRatio);
Image2.Height := Trunc(Image2.Height * AspectRatio);
}
OutputWidth := Image2.Width;
OutputHeight := Image2.Height;
// cooтношение ширины к высоте ~ 0,75
AspectRatio := OutputWidth / OutputHeight;
{необходимо привести к размеру 40Х30 мм}
//--------------------------------------
OutputHeight := StrToInt(Main.IniFilePrnt.ReadString('KK43','Ratio X', '100'));
//--------------------------------------
FX := StrToInt(Main.IniFilePrnt.ReadString('KK43', 'Foto_X', '0'));
FY := StrToInt(Main.IniFilePrnt.ReadString('KK43', 'Foto_Y', '0'));
// собственно печать фотки
Printer.Canvas.StretchDraw(Rect(FX, FY,
Trunc(FX + OutputHeight),
Trunc(FY + OutputHeight*AspectRatio)),
Image2.Picture.Graphic);
//Printer.Canvas.Draw(FX, FY, Image2.Picture.Bitmap);
|