CPEN
-
moin
CPen pen(PS_SOLID,1,color); CDC* pDC = pApp->mainwin->GetDC(); CPen* oldpen = pDC->SelectObject(&pen); pDC->SetBkMode(TRANSPARENT); pDC->SetTextColor(color); RECT r; r.left = r.top = 0; r.right = bw; r.bottom = bh; CFont font; CFont *oldfont; //ANZEIGEN LPT_BKF entry; muster = new unsigned char[obj->rastery * 32]; dib = new CDib(muster,obj->rasterx,obj->rastery,CDib::Grey_8_OVERLAY); int x=0; BOOL res=FALSE; for(int i=0; i<70; i++){ if(zeichen[i][1].CompareNoCase("TRUE")==0){ font.CreatePointFont(300,str); oldfont=pDC->SelectObject(&font); pDC->ExtTextOut(r.left+10, r.top+10, ETO_CLIPPED, &r, zeichen[i][0], NULL); pDC->ExtTextOut(r.left+10, r.top+400, ETO_CLIPPED, &r, "BITTE WARTEN", NULL); pDC->SelectObject(oldfont); pDC->SelectObject(oldpen); for(int y=0; y<150; y++){ for(int x=0; x<150;x++){ COLORREF c_KLS=pDC->GetPixel(x,y); pApp->picture[y*bw+x] = GetBValue(c_KLS); } } res=obj->TeachKLS(zeichen[i][0]); pApp->mainwin->ShowPicture(); Sleep(500); memset(pApp->picture, 255, bw*bh); pApp->mainwin->ShowPicture(); } }
ich hab euch da oben mal n kleinen code-schnipsel mitgebracht...
Was ich versuche: Schrift auf den Bildschirm zu schreiben !
Heist einfach ein weisses Bild auf dem z.b. ein A stehtsoweit funktioniert das auch
nun möchte ich diese schrift aber drehen ...
heist das man sie z.b. von nord nach süd lesen kann oder z.b. anders rum//CPen pen(PS_SOLID,1,color); CPen pen; // Create a geometric pen. LOGBRUSH logBrush; logBrush.lbStyle = BS_SOLID; logBrush.lbColor = RGB(0,255,0); logBrush.lbHatch = HS_BDIAGONAL; pen.CreatePen(PS_DOT|PS_GEOMETRIC|PS_ENDCAP_ROUND, 300, &logBrush); CDC* pDC = pApp->mainwin->GetDC(); CPen* oldpen = pDC->SelectObject(&pen); pDC->SetBkMode(TRANSPARENT); pDC->SetTextColor(color); RECT r; r.left = r.top = 0; r.right = bw; r.bottom = bh; //ANZEIGEN LPT_BKF entry; muster = new unsigned char[obj->rastery * 32]; dib = new CDib(muster,obj->rasterx,obj->rastery,CDib::Grey_8_OVERLAY); int x=0; BOOL res=FALSE; for(int i=0; i<70; i++){ if(zeichen[i][1].CompareNoCase("TRUE")==0){ pDC->ExtTextOut(r.left+10, r.top+10, ETO_CLIPPED, &r, zeichen[i][0], NULL); pDC->ExtTextOut(r.left+10, r.top+400, ETO_CLIPPED, &r, "BITTE WARTEN", NULL); pDC->SelectObject(oldpen); for(int y=0; y<150; y++){ for(int x=0; x<150;x++){ COLORREF c_KLS=pDC->GetPixel(x,y); pApp->picture[y*bw+x] = GetBValue(c_KLS); } } res=obj->TeachKLS(zeichen[i][0]); pApp->mainwin->ShowPicture(); Sleep(500); memset(pApp->picture, 255, bw*bh); pApp->mainwin->ShowPicture(); } }
dafür hab ich mir gedacht ich bau den LOGBRUSH ein nur leider funktioniert das net ... weder wird die schrift auf 300px gesetzt noch verändert sich die ausrichtung ... wieso ist das so ???
mfg LT
P.S.: so soll das aussehn:
-
das geht ganz einfach über den Font zu machen
LOGFONT lfontT; lfontT.lfHeight =-MulDiv(rect.Width()-9, GetDeviceCaps(pDC->m_hDC, LOGPIXELSY), 72); lfontT.lfWidth =0; lfontT.lfEscapement =900; //Winkel (90 grad) wie der Text Dargestellt wird lfontT.lfOrientation =0; lfontT.lfWeight =180; lfontT.lfItalic =TRUE; lfontT.lfUnderline =FALSE; lfontT.lfStrikeOut =FALSE; lfontT.lfCharSet =DEFAULT_CHARSET; lfontT.lfOutPrecision =OUT_DEFAULT_PRECIS; _tcscpy(lfontT.lfFaceName, "Arial"); m_fontT.CreateFontIndirect(&lfontT);
das ist nen auszug aus ner Source von mir wo der text von unten nacht oben Dargestellt wird
Hoffe hilft dir weiter.
-
thx das hat funktioniert