Bitmap in Static rein laden



  • Hallo,
    kann mir jemand helfen irgendwie wird mein Bitmap nicht in das Statische Feld geladen!

    for(i=0;i<Stats.kar.getHoehe();i++)
    	{
    		for(int j=0;j<Stats.kar.getBreite();j++)
    		{
    			CStatic *stat = new CStatic; 
    			liste.AddTail(stat);
    			CString str(Stats.kar.getAktuellChar(j, i));
    			if(str == "#") //MAUER
    			{
    				stat->Create(0, WS_CHILD | WS_VISIBLE | SS_CENTER | SS_BITMAP | SS_CENTERIMAGE, CRect(40+(10*j),50+(15*i),50+(10*j),65+(15*i)), this);
    				stat->SetBitmap(::LoadBitmap(AfxGetInstanceHandle(),(LPCTSTR) IDB_BITMAP1));
    			}
    			else if(str == " ") //Freies Feld
    				stat->Create(str, WS_CHILD | WS_VISIBLE | SS_CENTER , CRect(40+(10*j),50+(15*i),50+(10*j),65+(15*i)), this);
    			else if(str == "X") //SCHATZ
    				stat->Create(str, WS_CHILD | WS_VISIBLE | SS_CENTER , CRect(40+(10*j),50+(15*i),50+(10*j),65+(15*i)), this);
    			else if(str == "O") //SPIELER
    				stat->Create(str, WS_CHILD | WS_VISIBLE | SS_CENTER , CRect(40+(10*j),50+(15*i),50+(10*j),65+(15*i)), this);
    			else if(str == "B") //BOMBE
    				stat->Create(str, WS_CHILD | WS_VISIBLE | SS_CENTER , CRect(40+(10*j),50+(15*i),50+(10*j),65+(15*i)), this);
    			else if(str == "F") //BOHRER
    				stat->Create(str, WS_CHILD | WS_VISIBLE | SS_CENTER , CRect(40+(10*j),50+(15*i),50+(10*j),65+(15*i)), this);
    			else //Lauf Richtung "Fußabdrücke"
    				stat->Create(str, WS_CHILD | WS_VISIBLE | SS_CENTER , CRect(40+(10*j),50+(15*i),50+(10*j),65+(15*i)), this);
    		}
    	}
    


  • Warum LPCSTR vor der ID?



  • ohne SS_CENTER klappts nun


Anmelden zum Antworten