Click here to Skip to main content
15,895,848 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CPropertyPage's caption Pin
eli150219795-Aug-05 1:42
eli150219795-Aug-05 1:42 
GeneralRe: CPropertyPage's caption Pin
LiYS5-Aug-05 4:34
LiYS5-Aug-05 4:34 
GeneralRe: CPropertyPage's caption Pin
Marc Soleda5-Aug-05 4:47
Marc Soleda5-Aug-05 4:47 
GeneralRe: CPropertyPage's caption Pin
LiYS5-Aug-05 20:16
LiYS5-Aug-05 20:16 
GeneralRe: CPropertyPage's caption Pin
Marc Soleda7-Aug-05 20:42
Marc Soleda7-Aug-05 20:42 
QuestionHow to ignore the style of colspan of tablecells? Pin
123ivan1235-Aug-05 1:26
123ivan1235-Aug-05 1:26 
AnswerRe: How to ignore the style of colspan of tablecells? Pin
123ivan1236-Aug-05 21:33
123ivan1236-Aug-05 21:33 
GeneralProblem with OnPrint in MFC Pin
Puppet_5-Aug-05 0:17
Puppet_5-Aug-05 0:17 
Greetings.
I have the problem that my OnPrint-methode don't print my Bitmap. It's shown in the printpreview, but not printed. I didn't see the fault, cause it goes well. Without changing anything now it isn't printing the picture.....

Thx for help
Puppet

_____________________________________________________________________________-
Here the source:

void COutput2::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
int nSavedDC = pDC->SaveDC();


// Fussnoten setzen
CFont* pOldFont = pDC->SelectObject(&m_fontSet);
pDC->SetTextAlign(TA_LEFT|TA_BASELINE);
pDC->TextOut(HORZ_MARGIN,VERT_MARGIN,srkChange.strStatus);

// Tree initialisieren
CTreeCtrl& Tree = m_TreeWnd.GetTreeCtrl();
HTREEITEM hItem=Tree.GetRootItem();
int maxItemCnt = (prntY-VERT_MARGIN*2)/m_nRowHeight-2;

// Position im Tree ermitteln
for(int pos=0; pos<maxitemcnt*(pinfo->m_nCurPage-1); pos++)
{
Tree.Expand(hItem,TVE_EXPAND);
hItem = Tree.GetNextItem(hItem,TVGN_NEXTVISIBLE);
}


// Bildquelle übergeben
bm.LoadBitmap(IDB_TREE_ICON);
BITMAP bmpInfo;
bm.GetBitmap(&bmpInfo);

// Speicher anlegen und alten sichern
CDC SpeicherDC;
SpeicherDC.CreateCompatibleDC(pDC);
CBitmap * oldbm = SpeicherDC.SelectObject(&bm);


int ItemCnt=0;
do
{
ItemCnt++;

// Position ermitteln
int x = HORZ_MARGIN+CalculateRootCnt(hItem)*20;
int y = VERT_MARGIN+m_nRowHeight*(ItemCnt+1);

// Bild ermitteln
int nImage, nSelectedImage;
Tree.GetItemImage(hItem,nImage,nSelectedImage);

// Bild transparent machen (rosa->weiss)
for(int picx=0;picx<bmpinfo.bmwidth;picx++)
for(int="" picy="0;picy<bmpInfo.bmHeight;picy++)
" if(speicherdc.getpixel(picx,picy)="=RGB(255,0,255))
" speicherdc.setpixel(picx,picy,rgb(255,255,255));=""
="" bild="" an="" dc="" übergeben
="" pdc-="">BitBlt(x,y,bmpInfo.bmWidth/4,bmpInfo.bmHeight,
&SpeicherDC,bmpInfo.bmWidth/4*nImage,0,SRCCOPY);

// Tree-Text verarbeiten
CString text = Tree.GetItemText(hItem);
char tmp[256];
strcpy(tmp,text);

text = strtok( tmp, "\t" );
pDC->TextOut(x+25,y+BIAS,text);
text = strtok( NULL, "\t" );
pDC->TextOut(x+25+300,y+BIAS,text);

// Tree "aufklappen", nächstes Item
Tree.Expand(hItem,TVE_EXPAND);
hItem = Tree.GetNextItem(hItem,TVGN_NEXTVISIBLE);
}
while(hItem && ItemCnt<maxitemcnt);

fusszeile="" -=""> Seitenanzahl
CString nPage;
nPage.Format(" %d",pInfo->m_nCurPage);
nPage = UINTtoCString(IDS_OUT_PAGE) + nPage;
pDC->TextOut(prntX/2-nPage.GetLength(),prntY-20,nPage);

// alte Objekte zurücksetzen
pDC->SelectObject(pOldFont);
//pDC->SelectObject(oldbm);
pDC->RestoreDC(nSavedDC);
}
//OnPrint///////////////////////////////////////////////////////////////////
GeneralRe: Problem with OnPrint in MFC Pin
Puppet_7-Aug-05 20:21
Puppet_7-Aug-05 20:21 
GeneralQuestions About CHtmlView and A Web Browsing Program Pin
jdnx5-Aug-05 0:17
jdnx5-Aug-05 0:17 
GeneralRe: Questions About CHtmlView and A Web Browsing Program Pin
jdnx6-Aug-05 1:31
jdnx6-Aug-05 1:31 
Generalk8062d.dll Pin
Member 20880665-Aug-05 0:10
Member 20880665-Aug-05 0:10 
GeneralRe: k8062d.dll Pin
Marc Soleda5-Aug-05 0:22
Marc Soleda5-Aug-05 0:22 
GeneralRe: k8062d.dll Pin
5-Aug-05 0:30
suss5-Aug-05 0:30 
GeneralRe: k8062d.dll Pin
eli150219795-Aug-05 1:48
eli150219795-Aug-05 1:48 
Generaltocxx... plz explain Pin
Eytukan5-Aug-05 0:08
Eytukan5-Aug-05 0:08 
GeneralRe: tocxx... plz explain Pin
toxcct5-Aug-05 0:23
toxcct5-Aug-05 0:23 
GeneralRe: tocxx... plz explain Pin
Eytukan5-Aug-05 0:33
Eytukan5-Aug-05 0:33 
GeneralRe: tocxx... plz explain Pin
toxcct5-Aug-05 0:55
toxcct5-Aug-05 0:55 
General*Off Topic...* Pin
toxcct5-Aug-05 2:45
toxcct5-Aug-05 2:45 
GeneralRe: *Off Topic...* Pin
Eytukan5-Aug-05 3:37
Eytukan5-Aug-05 3:37 
GeneralRe: *Off Topic...* Pin
toxcct5-Aug-05 3:39
toxcct5-Aug-05 3:39 
GeneralRe: *Off Topic...* Pin
ThatsAlok5-Aug-05 23:59
ThatsAlok5-Aug-05 23:59 
GeneralRe: *Off Topic...* Pin
toxcct6-Aug-05 0:22
toxcct6-Aug-05 0:22 
GeneralExpression Evaluation urgent in c/c++ Pin
uma_kanth_k5-Aug-05 0:05
uma_kanth_k5-Aug-05 0:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.