PalmProgramming/다양한 기기의 고해상도 지원을 위한 팁

마지막으로 [b]

Here's the part of code I used in J-DOC reader or Date@G... The limitation is that this code allows only drawing. Editting in the field or table is not possible.

Err err;
BitmapType *bitmap;
BitmapTypeV3 *bitmap3;
WindowType *offscreen;
WindowType *current;
RectangleType rect;

current= WinGetDrawWindow();
WinPushDrawState();
WinSetCoordinateSystem( kCoordinatesDouble );

bitmap = BmpCreate( 480,32,1,(ColorTableType
*)&mono_clut,&err);
bitmap3 = BmpCreateBitmapV3( bitmap, kCoordinatesStandard,
BmpGetBits( bitmap), (ColorTableType *)&mono_clut);
offscreen = WinCreateBitmapWindow( (BitmapType *)bitmap3,
&err);
FntSetFont( stdFont );

WinSetDrawWindow(offscreen);

WinDrawChars( c, len, 0,0);

WinDeleteWindow( offscreen, false);
BmpSetDensity( (BitmapType *)bitmap3 , kCoordinatesDouble);
offscreen = WinCreateBitmapWindow( (BitmapType *)bitmap3,
&err);

RctSetRectangle( &rect,0,0,480,( ( FntCharHeight() + 2) / 2 +
1 ) / 2 * 2);
WinCopyRectangle( offscreen, current, &rect, x*2,y*2,
winPaint);

WinDeleteWindow( offscreen, false);
BmpDelete( (BitmapType *)bitmap3);
BmpDelete( bitmap);
WinPopDrawState();
WinSetDrawWindow(current);

At 00:16 02/12/20 -0700, John Gruenenfelder wrote:
>On Wed, Dec 18, 2002 at 07:43:39PM -0800, Ron Nicholson wrote:
> >Is it possible to copy the bytes (MemMove) from a low density
> >bitmap to a high density bitmap of the exact same size in bytes?
> >
> >Then you could draw low density fonts into a low density bitmap,
> >move the raw bytes to a high density bitmap (without pixel doubling),
> >and then draw that high density bitmap to the display.
> >
> >There's also a set of tiny OS 5 font resources somewhere on the
> >PalmSource web site.
>
>If I can find these fonts, and if they are accessible to all, then I think
>this would be my preferred solution for now. I honestly don't know how many
>people will want tiny text, but if I can point them to downloadable fonts,
>they could use them if they want. Weasel Reader has support for user supplied
>fonts.
>
>Barring that, though, your suggestion does sound like a good idea for
>implementing the drawing. Not too hard. I was also just thinking that the
>only real difference between high and low density bitmaps is the bit which
>specifies density. If this is the case, then I should be able to simply
>switch the bitmap to low density when I want to write text, then switch it
>back when I'm done. Does this sound like a reasonable idea?


WeeklyPlan에서는 OS5 고해상도를 지원하기 위해 결국 어떤 방법을 사용하셨는지 궁금하네요.
-- 조프 2004-1-19 12:30 pm
화면에 글을 출력하는 루틴에서는 Custom font loading하는 방식을, Agendus Icon과 note icon등을 처리할 때에는 offscreen image를 사용하고 있습니다. 차차 offscreen image를 처리하는 방식으로 바꾸려고 생각 중입니다(바꾼 다음에 한글이 제대로 처리될지 약간 걱정이 되어서 지금은 안하고 있지만요.)
-- Jmjeong 2004-1-19 2:07 pm

QVGA Display 루틴이 포함된 OS 에서는 WinSetScalingMode(UInt32 mode) 를 사용하는 방법도 있습니다. mode 에는 kBitmapScaliingOff, kBitmapTextOff, 등이 있어서, blitter 에게 자동 스케일링을 하지 말라고 지정해 줄수 있습니다. 특정 비트맵이나 글씨에 적용할 수 있으므로, 따로 폰트를 준비하거나, 폰트 스트럭쳐를 쪼개서 single density 만 출력할 필요가 없습니다. 폰트 스트럭쳐를 쪼개는 것이 offscreen 방식보다 훨~씬 빠르나, 역시 스트럭쳐를 직접 억세스 한다는 점에서 compatibility 가 떨어지겠죠. Diopen 의 한글은, 현재 출력하도록 설정되어 있는 폰트의 height 를 읽어서 매칭하는 방식 + 출력대상 화면의 bitmap Density 종류 분별 + 출력하려는 폰트의 종류 (standard/extended) 를 갖고 하는것 같습니다.
-- Omar 2004-2-6 11:16 am

만일 위의 방법이 아니라면, HALDrawChars 나 HALDraw_Chars 를 패치한다는 말이 되는데, 해당 함수들은 documentation 이 없기 때문에, 소스를 보지 않고는 어렵겠죠. HALDrawChars 의 인수만도 6개인지 7개인지 헛갈려 하고 있으니까요.

-- Omar 2004-3-4 6:16 pm

개발분류
트랙백 주고받기

마지막 편집일: 2004-3-4 6:21 pm (변경사항 [d])
2030 hits | 변경내역 보기 [h] | 페이지 소스 보기