Подпишитесь на наш Telegram-канал, чтобы всегда быть в курсе важных обновлений! Перейти

C++ How to put gif in Imgui?

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
20 Фев 2019
Сообщения
26
Реакции
3
could someone give me an example in code of how to implement .gif in Imgui, I was embarrassed to ask for help because I had already posted this before because I tried and I couldn't, I'm new with Imgui, I would like to ask for help from you on the forum, I tried to do it with the examples of "ocornut" but I couldn't understand it, I confess that my brain freezes when doing this LOL
 
Последнее редактирование модератором:
Are you joking or maybe you've been banned in Google?
1660299484175.png


upd. sorry, didn't see the last sentence
 
Последнее редактирование:
Well, in the cherax-menu-gtav menu there is an imgui menu with a gif that would be the animated logo of chearax
137024f7fcebb1a1295adcd82d21e884.jpg

good as you can see this imgui menu with gif
and the way I want to do it
 
Well, in the cherax-menu-gtav menu there is an imgui menu with a gif that would be the animated logo of chearax
good as you can see this imgui menu with gif
and the way I want to do it
ocornut has not yet added such a function to ImGui , and with the help of C ++ + ImGui you can’t render a gif file, you can go your own way and render a lot of pictures in a row, so that 1 frame would come out of them

this method has one fat minus - memory (RAM), it takes a lot of it for 1 good gif (depends on the size of your picture). (Around 300mb for me)

- here is showcase how i did this long time ago
 
could someone give me an example in code of how to implement .gif in Imgui, I was embarrassed to ask for help because I had already posted this before because I tried and I couldn't, I'm new with Imgui, I would like to ask for help from you on the forum, I tried to do it with the examples of "ocornut" but I couldn't understand it, I confess that my brain freezes when doing this LOL
разбей гиф на кадры и рисуй хех
 
разбей гиф на кадры и рисуй хех

Sorry Buddy !
i dont know how to do it
ocornut ainda não adicionou tal função ao ImGui , e com a ajuda de C++ + ImGui você não pode renderizar um arquivo gif, você pode seguir seu próprio caminho e renderizar muitas fotos seguidas, para que 1 quadro sairia deles

este método tem uma gordura menos - memória (RAM), é preciso muito dela para 1 bom gif (depende do tamanho da sua foto). (Cerca de 300mb para mim)

- aqui está uma demonstração de como eu fiz isso há muito tempo
[/CITAR]

Very good this loader that you showed me....



I'm amazed how they make Loader's with Imgui I want to learn more about ImGui I wanted to make a Loader like this one, I wanted to know how to make a progress bar like this, right next to the Login button, does anyone have a code explained


 
Последнее редактирование:
Sorry Buddy !
i dont know how to do it


Very good this loader that you showed me....



I'm amazed how they make Loader's with Imgui I want to learn more about ImGui I wanted to make a Loader like this one, I wanted to know how to make a progress bar like this, right next to the Login button, does anyone have a code explained



It's pretty good, but it also has a lot of bad moments. Perhaps soon I will post the source of some menu for easy study of design ImGui for beginners (maybe)
 
could someone give me an example in code of how to implement .gif in Imgui, I was embarrassed to ask for help because I had already posted this before because I tried and I couldn't, I'm new with Imgui, I would like to ask for help from you on the forum, I tried to do it with the examples of "ocornut" but I couldn't understand it, I confess that my brain freezes when doing this LOL
Probably the best way to do it is to use a single texture with all animation frames.

In my example, it looks like this:

T_Avatar_AnimatedMasterySavannah_Large.png


It's 2048 x 2048 texture, so each frame will be 512 x 512, which is not bad.

ImGui and many other rendering libraries or game engines have the ability to draw a part of an image.
The part is defined by UV. You can think of it as a normalized 2D Vector(ImVec2 in your case) values of which
vary from 0 to 1 and basically mean size of current texture in percents.

Thus, by using UV as an argument in your DrawImage call you need only 1 texture
to draw your animation, that's a hundred times better than importing every single frame.

In code, it looks very compact.
Пожалуйста, авторизуйтесь для просмотра ссылки.
, but I'm not using ImGui, I hope you're clever enough to adapt it to ImGui on your own.
(You can use
Пожалуйста, авторизуйтесь для просмотра ссылки.
to have a clue how this works in ImGui. Almost no differences)

1660605986806.png


The final result looks like this:

 
Последнее редактирование:
Probably the best way to do it is to use a single texture with all animation frames.

In my example, it looks like this:

Посмотреть вложение 217092

It's 2048 x 2048 texture, so each frame will be 512 x 512, which is not bad.

ImGui and many other rendering libraries or game engines have the ability to draw a part of an image.
The part is defined by UV. You can think of it as a normalized 2D Vector(ImVec2 in your case) values of witch
vary from 0 to 1 which basically means size of current texture in percents.

Thus, by using UV as an argument in your DrawImage call you need only 1 texture
to draw your animation, that's a hundred times better than importing every single frame.

In code, it looks very compact.
Пожалуйста, авторизуйтесь для просмотра ссылки.
, but I'm not using ImGui, I hope you're clever enough to adapt it to ImGui on your own.
(You can use
Пожалуйста, авторизуйтесь для просмотра ссылки.
to have a clue how this works in ImGui. Almost no differences)

Посмотреть вложение 217093

The final result looks like this:

Thanks,
for taking some of your time to explain to me how this works, thank you so much!
 
Назад
Сверху Снизу