freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft] about setting character sizes


From: Mickey Gabel
Subject: Re: [ft] about setting character sizes
Date: Thu, 16 Apr 2009 11:59:08 +0300
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

harshagomes wrote:

//the function
void draw_bitmap( FT_Bitmap*  bitmap, FT_Int x, FT_Int y )
{
    FT_Int  i, j, p, q;
    FT_Int  x_max = x + bitmap->width;
    FT_Int  y_max = y + bitmap->rows;

    for ( i = x, p = 0; i < x_max; i++, p++ )
    {
      for ( j = y, q = 0; j < y_max; j++, q++ )
      {
         if ( i < 0      || j < 0       ||
              i >= width || j >= height )
                         continue;
        else
{ BYTE r = bitmap->buffer[q * bitmap->width + p];
                BYTE g = bitmap->buffer[q * bitmap->width + p];
                BYTE b = bitmap->buffer[q * bitmap->width + p];
                BYTE a = 255;
RGBQUAD colorbit = { r,g,b,a }; OutputBuffer[ i ][ j ] = colorbit; }
      }
   }
}



as explained, if i try to blit the 'OutputBuffer' onto the window DC, am
gettin the texts crumpled..

i really cant figure out the reason why am getting like this..
am struck up with this for quite some time... so pls help...
thanks.

"q * bitmap->width" may be the problem. You should be using "bitmap->pitch".







reply via email to

[Prev in Thread] Current Thread [Next in Thread]