Вопрос Как сюда запихнуть картинку моргенштерна

Памагите
Пользователь
Статус
Оффлайн
Регистрация
15 Апр 2021
Сообщения
248
Реакции[?]
46
Поинты[?]
5K
Короче я в плюсах полный ноль
Я хочу чтобы в меню этого чита (
Пожалуйста, авторизуйтесь для просмотра ссылки.
)
1671388456229.png
Вместе серых тонов был моргенштерн
maxresdefault.jpg
 
Забаненный
Статус
Оффлайн
Регистрация
27 Ноя 2022
Сообщения
12
Реакции[?]
1
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Короче я в плюсах полный ноль
Я хочу чтобы в меню этого чита (
Пожалуйста, авторизуйтесь для просмотра ссылки.
)
Посмотреть вложение 232037
Вместе серых тонов был моргенштерн
Посмотреть вложение 232036
меняй background на картинку, рендеренную с помощью imgui
 
pro master
Пользователь
Статус
Оффлайн
Регистрация
8 Июн 2020
Сообщения
233
Реакции[?]
86
Поинты[?]
5K
To use a picture as the background for an ImGui menu in C++, you can use the ImGui::GetBackgroundDrawList function to get the ImDrawList object for the current window, and then use the ImDrawList::AddImage function to add the image to the draw list.
C++:
#include "imgui.h"
#include "imgui_impl_sdl.h"
#include "imgui_impl_opengl3.h"

// Initialize ImGui
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
(void)io;
ImGui::StyleColorsDark();

// Load the image file
ImTextureID texture = ImGui_ImplSDL2_LoadTexture("background.png");

while (true)
{
    // Begin a new ImGui frame
    ImGui::NewFrame();

    // Create the menu
    ImGui::Begin("Menu", NULL, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoCollapse);

    // Get the ImDrawList for the current window
    ImDrawList* drawList = ImGui::GetBackgroundDrawList();

    // Add the image to the draw list
    ImVec2 pos = ImGui::GetWindowPos();
    ImVec2 size = ImGui::GetWindowSize();
    drawList->AddImage(texture, pos, ImVec2(pos.x + size.x, pos.y + size.y));

    // Add menu items here...

    ImGui::End();

    // Render the ImGui widgets
    ImGui::Render();
}
If you want to load the picture as bytes, you might do something like this

C++:
#include "imgui.h"
#include "imgui_impl_sdl.h"
#include "imgui_impl_opengl3.h"

// Initialize ImGui
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
(void)io;
ImGui::StyleColorsDark();

// Load the image data from a byte array
const unsigned char* imageData = ...;
int imageWidth = ...;
int imageHeight = ...;
ImTextureID texture = 0;

// Create the ImTextureID object from the image data
ImDrawListSharedData* sharedData = ImGui::GetDrawListSharedData();
if (sharedData)
{
    texture = sharedData->MemoryCompressImTextureID(imageData, imageWidth, imageHeight);
}

while (true)
{
    // Begin a new ImGui frame
    ImGui::NewFrame();

    // Create the menu
    ImGui::Begin("Menu", NULL, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoCollapse);

    // Get the ImDrawList for the current window
    ImDrawList* drawList = ImGui::GetBackgroundDrawList();

    // Add the image to the draw list
    ImVec2 pos = ImGui::GetWindowPos();
    ImVec2 size = ImGui::GetWindowSize();
    drawList->AddImage(texture, pos, ImVec2(pos.x + size.x, pos.y + size.y));

    // Add menu items here...

    ImGui::End();

    // Render the ImGui widgets
    ImGui::Render();
}
 
Сверху Снизу