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 leute

ich habe ein Handle auf ein Bitmap (HBITMAP).

ist es möglich dieses Bild auf eine Bestimte größe zu ziehen?

sagen wir ich brauch das bild in der größe von 100x100 Pixeln!

hab zwar schon in google gesucht, aber ich weiß nicht wirklich wie sowas aussehen könnte (vermutlich hab ich deshalb nichts gefunden)

kann mir jemand helfen?

wär toll

Danke SwordMaster

  • Autor

am besten wär wenn ich ein neues HBITMAP bekomme was auf das "Neue verkleinerte Bitmap" verweist...

ich möchte das bild dann in einem CStatic anzeigen

<mit m_bild.SetBitmap(...)>

an StretchBlt hätte ich auch schon gedacht, aber dazu brauch ich ja ein HDC und kein HBITMAP. oder kann ich ein HBITMAP auf ein HDC umwandeln?.

Ich hab hier einen kleinen Ausschnitt aus einem Programm von mir, das sollte das Vorgehen verdeutlichen:


HDC hDest,hSrc;
HBITMAP hBitmap;
BITMAP Info;

//Bitmap laden
//hBitmap = (HBITMAP)LoadImage(0,"c:\\test.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
//if (hBitmap == NULL)
//{
//Wenn Bitmap nicht vorhanden Standartresource nehmen
hBitmap = LoadBitmap(hInst,MAKEINTRESOURCE(IDB_BITMAP1));
//}
//Infos über das Bitmap holen
GetObject(hBitmap,sizeof(Info),&Info);

hDest = GetDC(hMainWindow); //Device Context des Fensters holen
hSrc = CreateCompatibleDC(hDest); //Compatiblen DC zum Fensters erstellen
SelectObject(hSrc,hBitmap); //Bitmap in Compatiblen DC laden

//Bitmap vom Compatiblen DC in den DC des Fensters kopieren
//TransparentBlt(hDest,10,170,200,80,hSrc,0,0,Info.bmWidth,Info.bmHeight,RGB(195,196,195));
BitBlt(hDest,30,187,Info.bmWidth,Info.bmHeight,hSrc,0,0,SRCCOPY);
//Variablen und Handles wieder freigeben
ReleaseDC(hMainWindow,hDest);
DeleteDC(hSrc);
DeleteObject(hBitmap);
[/PHP]

Statt BitBlt kannst du ja einfach StretchBlt nehmen.

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.