웹 페이지에 포함 할 PNG로 변환하려고 시도하는 일련의 Microsoft ISF (잉크 연속 서식) 이미지가 있습니다.Microsoft ISF에서 정확한 BoundingBox를 사용 하시겠습니까?
이byte[] data; // data has the raw bytes of the ISF file
Ink ink = new Ink();
Renderer renderer = new Renderer();
Stream outStream; // a Stream to hold the PNG data
ink.Load(data);
using (Strokes strokes = ink.Strokes) {
// get bounds of ISF
rect = strokes.GetBoundingBox(BoundingBoxMode.PointsOnly);
// create bitmap matching bounds
bm = new Bitmap(rect.Width, rect.Height);
// draw the ISF onto the Bitmap
using (Graphics g = Graphics.FromImage(bm)) {
g.Clear(Color.Transparent);
renderer.Draw(g, strokes);
}
}
// save the Bitmap to PNG format
bm.Save(outStream, System.Drawing.Imaging.ImageFormat.Png);
... 그러나, 이미지 크기가 비정상적으로 큰 것 같다 : 나는 성공적으로 비트 맵에 잉크를 그리고 PNG로 저장하는 C# 패키지 Microsoft.Ink을 사용했다. GetBoundingBox 메서드에 전달 된 BoundingBoxMode 열거 형을 변경하면 아무 것도 변경되지 않으며 465 픽셀 x 660 픽셀이고 실제 공간에서 25 자 x 30 픽셀을 차지하는 'a'필기체 만 포함하는 이미지를 얻게됩니다.
더 정확한 경계 상자를 가져 오는 방법에 대한 제안 사항이 있으십니까?