|
From: | José Carlos García Rufino |
Subject: | [Devel] Some characters don´t draw right |
Date: | Thu, 23 Jan 2003 18:36:25 +0100 |
I have a function for drawing a character in the
screen. I use FT_Load_Char(...,FT_LOAD_RENDER) for rendering this
character.
The problem is that many charartes are drawing bad
(B,C,D,F,H,...) and others are drawind right( A,E,M,G,W, ...)
I don't know the reason.
I use W2000 pro and VC 6.0 SP5.
The function is the next:
void my_draw_bitmap(HDC hDC,FT_Bitmap b, int posx,
int posy, int zoom)
{ int tam,filas,columnas; filas=b.rows; columnas=b.width; tam=filas*columnas; BITMAPINFO *bmi; bmi = (BITMAPINFO *) malloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); bmi->bmiHeader.biSize =
sizeof(BITMAPINFOHEADER);
bmi->bmiHeader.biWidth = columnas; bmi->bmiHeader.biHeight = -filas; // top-down image bmi->bmiHeader.biPlanes = 1; bmi->bmiHeader.biBitCount = 8; bmi->bmiHeader.biCompression = BI_RGB; bmi->bmiHeader.biSizeImage = filas*columnas; bmi->bmiHeader.biXPelsPerMeter = 0; bmi->bmiHeader.biYPelsPerMeter = 0; bmi->bmiHeader.biClrUsed = 0; bmi->bmiHeader.biClrImportant = 0; RGBQUAD *paleta=(LPRGBQUAD)(((BYTE *)(bmi)) + sizeof(BITMAPINFOHEADER)); for (int i = 0; i < 256; i++) { paleta->rgbBlue = paleta->rgbGreen = paleta->rgbRed = (BYTE) i; paleta->rgbReserved = 0; paleta++; } StretchDIBits(hDC, posx, // x destino posy, // y destino columnas*zoom, // ancho destino filas*zoom, // alto destino 0, // x fuente 0, // y fuente columnas, // ancho fuente filas, // alto fuente b.buffer, // puntero a los bits bmi, // BITMAPINFO DIB_RGB_COLORS, // options SRCCOPY); // rop free(bmi);
} |
[Prev in Thread] | Current Thread | [Next in Thread] |