Aide - Recherche - Membres - Calendrier
Version complète : Help HIRES FONT sur OS 5
Les Forums de PalmAttitude.org > GENERAL PalmOS > Développement sous PalmOS
ngc666
icon_cry2.gif J'ai récupéré une procédure sympathique (un peu trafiquée pour le centrage) pour afficher du texte en Hires sur mon zire 71. Le problème très gênant pour mon appli, c'est que je n'arrive pas à contrôler la couleur du texte affiché même avec avec la fonction winsetforcolor ??? Si quelqu'un à une idée... Peut-être est-ce du au fait que l'écran offscreen n'est pas dans le meme depth que mon appli (je suis en 256 couleurs) ?


static void WinPaintCharsSmall(const Char *chars, Coord x, Coord y)
{
WinHandle tempWind, oldWindow;
Err Error;
BitmapPtr bmpP;
BitmapTypeV3 *bmpHDP;
UInt16 oldCoord, lx, ly;

oldCoord = WinSetCoordinateSystem(kCoordinatesStandard);

ly = FntLineHeight();
lx = FntLineWidth(chars, StrLen(chars));

// Step 1: Create an off-screen, low-density window.
tempWind = WinCreateOffscreenWindow(lx, ly, genericFormat, &Error);
bmpP = WinGetBitmap(tempWind);
BmpSetDensity(bmpP, kDensityLow);

// Step 2: Switch to said window.
oldWindow = WinSetDrawWindow(tempWind);

// Step 3: Draw the text to our temporary window.
WinPaintChars(chars, StrLen(chars), 0, 0);

// Step 4: Switch back to the original window.
WinSetDrawWindow(oldWindow);

// Step 5: Create a HD bitmap from the window.
bmpHDP = BmpCreateBitmapV3(bmpP, kDensityDouble, BmpGetBits(bmpP), NULL);

// Step 6: Draw the temporary bitmap to the active window.
WinPaintBitmap((BitmapPtr)bmpHDP, x, y);

// Step 7: Free the temporary window and bitmap.
WinDeleteWindow(tempWind, false);
BmpDelete((BitmapPtr)bmpHDP);
}
ngc666
icon_bla.gif il fallait tout simplement utiliser WinSetTextColor et non WinSetForeColor, désolé ...
Patrice
Désolé de ne pas avoir vu ton post plus tôt, j'aurais pu te donner la réponse...
Ceci est une version "bas débit" de notre forum. Pour voir la version complète avec plus d'information, la mise en page et les images, veuillez cliquer ici.
Invision Power Board © 2001-2008 Invision Power Services, Inc.