Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo an alle Zeichner!


CImage img;


CImage img.Load("Bild.jpg");


CDC *pDC=CDC::FromHandle(img.GetDC());


//keine weitere Bearbeitung oder pDC->DrawText()


img.Save("NeuBild.jpg");


img.ReleaseDC();

Beim Laden hat das Bild eine Auflösung von 420x420. Beim Speichern aber 1748x1748.

Die Bilder haben beide 96 DPI.

Warum wird die Auflösung geändert ohne dass ich was dazu tun muss bzw. was kann ich dagegen tun?

VC++ 2003, Konsole-Programm

  • Autor

Dann mal hier etwas vom Rest, Text zeichnen:


CDC *pDC=0;


int main()

 {

  CImage img;


  img.Load("Bild.jpg")


  pDC=CDC::FromHandle(img.GetDC());


  CRect rect; //hier wird der Output-Bereich festgelegt


  rect.top=150;


  rect.left=550;


  rect.bottom=rect.top+60;


  rect.right=rect.left+800;


  DrawText("Text", 48, rect); //hier muss ich die Schriftgröße ziemlich groß wählen, da sie sonst auf dem neuen Bild kaum zu erkennen ist.


  img.Save("NeuBild.jpg");


  img.ReleaseDC();

 }//end int main();


void DrawText(CString Text, CRect rect, int hoehe);

 {

  CFont font;

  LOGFONT lFont;


  ZeroMemory(&lFont, sizeof(LOGFONT));


  lFont.lfHeight=hoehe;


  lFont.lfWeight=FW_EXTRABOLD;


  strcpy(lFont.lfFaceName, "Verdana");


  VERIFY(font.CreateFontIndirect(&lFont));


  CFont* def_font=pDC->SelectObject(&font);


  pDC->DrawText(Text, Text.GetLength(), rect, DT_VCENTER|DT_END_ELLIPSIS|DT_LEFT|DT_NOFULLWIDTHCHARBREAK|DT_WORDBREAK);


  font.DeleteObject();

 }//end void DrawText()

Bearbeitet von Narf!

  • Autor

Ach Mensch! :old

Man sollte natürlich darauf achten, dass man auch das richtige Basis-Bild lädt.:upps

Also die Maße bleiben gleich, wie schon erwähnt.

Ich denke mal, man kann das Thema löschen, oder?

  • 1 Monat später...

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.