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

Hi,

ich habe ca. 100 Bilder (verschiedene Größen) in einem Ordner und möchte in jedes dieser Bilder einen Text schreiben, der im rechten unteren Eck erscheinen soll.

Benutze VC 7.0, MFC und GDI+

Thx für jede Hilfe !

  • Autor

Nein sorry war vielleicht schlecht gesagt ... dann steht nur noch der Text da und das Bild ist weg ...

Und ich will ja das das Bild bleibt und der Text darin steht.

USES_CONVERSION;

Image* image = new Image(T2W(filename));

Bitmap* image2 = new Bitmap(sizex, sizey, image->GetPixelFormat());

Graphics graphics(image2);

graphics.DrawImage(image, 0, 0, sizex, sizey);

if(m_bText)

{

FontFamily fontFamily(L"Times New Roman");

Font font(&fontFamily, 24, FontStyleRegular, UnitPixel);

PointF pointF(10.0f, 10.0f);

SolidBrush solidBrush(Color(128, 128, 128, 128));

graphics.DrawString(L"HALLO", -1, &font, pointF, &solidBrush);

}

Ach und m_bText ist 1 ich habs mit der MessageBox geprüft.

Das ist mein momentaner Testansatz aber vom Text ist NICHTs zu sehen.

Original geschrieben von Scratch

SolidBrush solidBrush(Color(128, 128, 128, 128));

...

Das ist mein momentaner Testansatz aber vom Text ist NICHTs zu sehen.

Je nach Bitmap kann ein halbtransparenter, grauer Text schwer zu erkennen sein. Mach den Text doch mal gelb und deckend:

SolidBrush solidBrush(Color(255, 255, 255, 0));

Es könnte an einem ungültigen Pixelformat liegen. Der Graphics-ctor Graphics::Graphics(Image*) schlägt bei den folgenden Pixelformaten fehl:

PixelFormatUndefined

PixelFormatDontCare

PixelFormat1bppIndexed

PixelFormat4bppIndexed

PixelFormat8bppIndexed

PixelFormat16bppGrayScale

PixelFormat16bppARGB1555

Du kannst das testen, indem du nach dem Erzeugen des Graphics-Objekts den Status prüfst:

Status s = graphics.GetLastStatus();

Wenn dabei nicht Null (bzw. Ok) rauskommt, hat es nicht geklappt. Dann kannst du versuchen, einfach mal ein anderes Format vorzugeben.

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.