Windows GUI Programming with C/C++ ( Win32 API ) | Part -5 | Working with Images (Bitmaps)

  Рет қаралды 58,690

The Pentamollis Project

The Pentamollis Project

Күн бұрын

Пікірлер: 100
@nybon8767
@nybon8767 4 жыл бұрын
The picture is not showing displayed.
@luisponce3580
@luisponce3580 4 жыл бұрын
Hey, just wanted to remind you that you are the best!
@LARathbone
@LARathbone 3 жыл бұрын
This is a great series! I was curious to see how the win32 API works in C after starting my Gtk tutorial on Linux. Very interesting to see how the raw C APIs work on the Windows side.
@urhur
@urhur 7 жыл бұрын
I'm from Brazil! I love your classes! You are very clever!
@ThePentamollisProject
@ThePentamollisProject 7 жыл бұрын
Thank you :-)
@vitorbarrosaschama2277
@vitorbarrosaschama2277 4 жыл бұрын
eai
@kaicsmm
@kaicsmm 3 жыл бұрын
Eu também sou do Brasil
@baltazarus3307
@baltazarus3307 5 жыл бұрын
Dude, you're genius! Great tutorial!
@OuassimPelke
@OuassimPelke 3 ай бұрын
you are so good
@EarthSettler
@EarthSettler 7 жыл бұрын
i am really learning a lot here, thank you a lot!!! thank you!, keep up the good works
@ThePentamollisProject
@ThePentamollisProject 7 жыл бұрын
:-) you're welcome
@LVTMVP
@LVTMVP 5 жыл бұрын
How can i make the image transparent? The image takes up the whole window (This is intended) and covers all the text box. How can i make it transparent so that i can see the messages/text box?
@calibr0636
@calibr0636 5 жыл бұрын
yo, my bitmap images don't work, and they are in the same directory as the app
@dilanbarham3121
@dilanbarham3121 3 жыл бұрын
that is because you made the size 0,0 void loadImage() { hLogoImage = (HBITMAP)LoadImageW(NULL,L"C++-Logo.bmp",IMAGE_BITMAP, 100 , 100 ,LR_LOADFROMFILE); } make it 100x and 100y
@dilanbarham3121
@dilanbarham3121 3 жыл бұрын
set the size you might set it as 0 ZERO.
@devcode9290
@devcode9290 2 жыл бұрын
Thanks man! It is so clear and useful.
@stefanmoser4348
@stefanmoser4348 7 жыл бұрын
very nice video and very useful to learn WIN32API. you are explaining very clearly and it's for me easy to follow you. salutation from Austria 🙂
@ThePentamollisProject
@ThePentamollisProject 7 жыл бұрын
it really feels wonderful to read comments from viewers like you. I'm really glad that I could be of help :-)
@stefanmoser4348
@stefanmoser4348 7 жыл бұрын
you'r wellcome :-) last week I tried to install wxWidgets 3.0.2 under Code::Blocks 16.01. till today it doesn't work at all. have you already mady any experiences with wxWidgets? saltutation from rainy Austria :-)
@ThePentamollisProject
@ThePentamollisProject 7 жыл бұрын
no i've never used that before.
@stefanmoser4348
@stefanmoser4348 7 жыл бұрын
it doesn't matter. I've not used it either :-) then I wait for part 6. btw: how long is 'in about 20 days' in India? ;-)
@ThePentamollisProject
@ThePentamollisProject 7 жыл бұрын
"in about 20 days" means the same in India as it does in Australia :-p
@PerchEagle
@PerchEagle Жыл бұрын
How to refresh a new page ? Because when I get back to the first page, there still some stuff from the second page.
@Nightowl_IT
@Nightowl_IT 2 жыл бұрын
Thanks for the Tutorial. You could improve this one by adding a link in the description of the video with the files needed for the tutorial.
@bennyandersen742
@bennyandersen742 Жыл бұрын
Thanks, can you load an image using a button? I tried that with a function, but nothing happened, it worked with the WM_PAINT method
@jeffparkhurst4585
@jeffparkhurst4585 6 жыл бұрын
How would you load an image if you wanted to be something other than square? For instance, if you wanted the image to be hexagonal?
@veggieboy1
@veggieboy1 2 жыл бұрын
I'm not sure but perhaps you would have to do it manually using the SetPixel() function in a loop whilst reading from the image?
@atmadeepmukherjee5550
@atmadeepmukherjee5550 4 жыл бұрын
Sir, I am writing the exact same code. I also downloaded BMP Files from the Internet. But they are not working. The images are not shown. Can you please help me?
@phamminh3618
@phamminh3618 2 жыл бұрын
img from download not convert to .bmp yet, try to convert it, instead of set the tail to bmp
@adamabdessamad9805
@adamabdessamad9805 7 жыл бұрын
I love this serie you helped me a lot , actually ,I have a personal question for you, how old are you?
@ThePentamollisProject
@ThePentamollisProject 7 жыл бұрын
I'm 16 😅
@adamabdessamad9805
@adamabdessamad9805 7 жыл бұрын
you are a prodigy
@ThePentamollisProject
@ThePentamollisProject 7 жыл бұрын
well thanks a lot ,but ive still got a lot to learn. :-)
@1oneorigin50
@1oneorigin50 6 жыл бұрын
waaaaat???????
@ThePentamollisProject
@ThePentamollisProject 5 жыл бұрын
@Aytunc Demir yeah. Just started college a month ago.
@peterSobieraj
@peterSobieraj 5 жыл бұрын
Thank you man. I was looking for example of that code everywhere. It works for me.
@ricardomunhoz6706
@ricardomunhoz6706 7 жыл бұрын
Very good, my King. Waiting for the next.
@ThePentamollisProject
@ThePentamollisProject 7 жыл бұрын
about 20 days for the next part .... stay tuned :-)
@blackheart2728
@blackheart2728 6 жыл бұрын
Quick question; can I add and remove copies of an image from a handler? so it holds multiple of one image at various parts of the screen?
@sarahhesham6309
@sarahhesham6309 3 жыл бұрын
How to take save my window image, I mean in Win32, I am drawing figures like circle, lines, ellipse... after drawing them, how to save them and then load them back on my window ?????PLEASE help me
@Ragnark1
@Ragnark1 5 жыл бұрын
I have been steadily learning WIN 32 C++ programming. I am wondering if it is easily possible to add a bitmap AND text to a button. I can do either or but nothing seems to make it possible to do both. I also can't move the bitmap from the center of the button. Is there is a way to manipulate the bitmap after it has been instantiated as an image on a button? Thanks in advance.
@idol2010
@idol2010 5 жыл бұрын
Send link to the full projects pls
@valizeth4073
@valizeth4073 6 жыл бұрын
Not working for me, i've done exactly the same, not getting any error or nothing :/
@OneMeanDragon
@OneMeanDragon 6 жыл бұрын
dont forget to post what ver of windows
@valizeth4073
@valizeth4073 6 жыл бұрын
Win10. The windows api shouldnt be dependent on the windows version thi.
@valizeth4073
@valizeth4073 6 жыл бұрын
Nah, I usually use linux anyways so I decided to learn QT. Winapi just gives me nightmares. Specially when mixing C and C++
@valizeth4073
@valizeth4073 6 жыл бұрын
I've done error checking and it doesn't return anything, I know how you specify an item in a string.
@seditt5146
@seditt5146 6 жыл бұрын
Remember that the path starts with the location of the Project when it is run from something like the VS editor and the location where the EXE file is when run outside of the Editor. For this reason whenever I am attempting to load files in VS I hard code the entire file location or many times #define a macro for my file location so that when I am running in release mode the Macro gets blanked out IE #define FILEPATH(x) C:\Window\(x) So when I am debugging I FILEPATH\File.BMP or something of that nature.
@TrungHieuNguyen-gp4xr
@TrungHieuNguyen-gp4xr 3 жыл бұрын
can u guide how to use transparentBlt function ?
@agentstona
@agentstona 2 жыл бұрын
hey man you didnt need to use a second send message for the Button click , you could just paste SendMessageW(show_image,STM_SETIMAGE,IMAGE_BITMAP,my_image); under the case button_click command .
@ravina05
@ravina05 3 жыл бұрын
thank you very well explained it helps me
@gregwoolley
@gregwoolley 2 жыл бұрын
Thanks, well explained.
@Lee-jh3rv
@Lee-jh3rv 7 жыл бұрын
Hi, thank you. This is quite clear. I have a question. If I already have a BIG code for calculating. How can I combine my code together with this API?
@ThePentamollisProject
@ThePentamollisProject 7 жыл бұрын
Well thats up to you, and in fact it depends on the code you have. So unless you explain to me the entire code, i can't really help you with much of the GUI part. There are basically three GUI elements corresponding to some actions: 1. Static controls to guide the user 2. Edit boxes to input the data from the user 3. Buttons for triggering certain events. You can use the other controls like menus, image controls dialog boxes ( part - 7 in this series ) etc. to make your application more feasible. Goodluck !
@Lee-jh3rv
@Lee-jh3rv 7 жыл бұрын
Thanks for answering my questions. I have a 5000 lines codes to solve highly couple equations. So my code can be seen as a c++ code to solve matrix. I want to know how to show the results (I printed in.txt) on the screen using GUI. I am confusing how to insert my code combine with the GUI display...
@Ghost572
@Ghost572 6 жыл бұрын
Given we've already been displaying things, one way would be to display things as strings thats including numbers. There are commands to convert integers to strings and vice versa or you could program it to convert numbers back from strings to intergers if it came to it. I'm fairly sure though everything will have to be dealt with in strings, atleast when it comes to displaying and taking in inputs. I've already done a text based GUI and it required a lot of converting back and too between strings and real values. It wasn't that hard to do just involved a lot of if else statements but overall it worked. I'm fairly sure though as I continue to code I will find more effective methods to do this.
@MasterMindmars
@MasterMindmars 2 жыл бұрын
Very good
@code-to-learn
@code-to-learn 3 жыл бұрын
Really, you are the best
@AlexAlex-vk2ti
@AlexAlex-vk2ti 7 жыл бұрын
can you show us , how to capture the computer camera and put it instead of the logo, so that we can see camera working in the Interface instead of the Logo. i will be thankfull.
@skillerdz7145
@skillerdz7145 6 жыл бұрын
all you'r tutorials are working , except something , when you add bitmap image to the script its block the menus like Help and File etc..
@anisourajini1274
@anisourajini1274 7 жыл бұрын
Great work , thank you , but the image does not appear whene i build and run the program help me please
@Ghost572
@Ghost572 6 жыл бұрын
This will be because your image is not a 32bitdepth you can use a program like iconfx 3 to make the icon and set it up so its has a 32 bit depth.
@charlesbenca5357
@charlesbenca5357 5 жыл бұрын
@@Ghost572 Thank you very much. I would never have found my problem. I tried 32bit and it didn't work so i tried 24bit and everything works now thanks.
@Ghost572
@Ghost572 6 жыл бұрын
What bitdepth is your icon/bmp file. I had the issue that it wont work unless its a 32bitdepth so I had to get some additional software to design icons on. Shame paint only does 24 bit depth: ( p.s: Just an update it does require 32bitdepth in order to work and I used the trail of iconfx 3 to make my icons, you can choose 32bit depth from that.
@ThePentamollisProject
@ThePentamollisProject 6 жыл бұрын
My bmp's were 24 bit and it worked fine. I used paint. :-/
@Ghost572
@Ghost572 6 жыл бұрын
I know what i've done wrong, I didn't put the name in so I will try 24 bit again. I'm pretty sure its a requirement for when your putting icons (as in .ico) in like when you press ALT TAB and you can see the icon, and also the icon in the top left corner of a program. Its mainly the reason I was reading about these bit depths when I was trying to make icons work, it would just give the error that the .ico file is not of the correct data type.
@schmidtlach
@schmidtlach 3 жыл бұрын
Great tutorial
@Sand1234
@Sand1234 3 жыл бұрын
can someone help me, i want to use PNGs but i can't find anything on the internet that i can understand under 3 months and i learned all the details of his videos within 2 weeks. send help
@idol2010
@idol2010 5 жыл бұрын
not Work in Visual Studio.......
@leejm4
@leejm4 5 жыл бұрын
very good tutorial
@Proto850
@Proto850 7 жыл бұрын
We need more, maybe do something about treeviews or listviews!
@ThePentamollisProject
@ThePentamollisProject 7 жыл бұрын
next part will be a detailed account of the message box dialog. upcoming parts will cover modeless dialogs and some more controls of the API.. after this series is over ... I'll begin a new series about the windows GDI.
@kaicsmm
@kaicsmm 3 жыл бұрын
VERY VERY VERY VERY THANK YOU
@narcoticparadise2023
@narcoticparadise2023 4 жыл бұрын
hey duude please the source code, i face some problemes. my window title shows in asian caracteres and have some bugs with the text editing
@מקסגופמן
@מקסגופמן 4 жыл бұрын
try to use wcscpy and wscat instead
@Derively
@Derively 5 жыл бұрын
It simply doesn't work for me. There is no error message, the window opens, but there is no image. I placed the bmp file in multiple locations, but none of them worked. Edit: It works with a different image. I guess the first one had a problem.
@abdulrahmantakriti6769
@abdulrahmantakriti6769 5 жыл бұрын
It gives no error but it shows only blank square for me no matter which image i select, would you please explain further how did you solve it ?
@Derively
@Derively 5 жыл бұрын
@@abdulrahmantakriti6769 For me, there was no black square either. This was with an image that was converted from jpg to bmp. Then I downloaded an original bmp image, and that worked.
@abdulrahmantakriti6769
@abdulrahmantakriti6769 5 жыл бұрын
@@Derively ok thanks !
@TheJaniczek
@TheJaniczek 6 жыл бұрын
I'm getting: |175|error: cannot convert 'HWND {aka HWND__*}' to 'HBITMAP {aka HBITMAP__*}' in assignment| |181|error: cannot convert 'HBITMAP {aka HBITMAP__*}' to 'HWND {aka HWND__*}' for argument '1' to 'LRESULT SendMessageW(HWND, UINT, WPARAM, LPARAM)'| Did anyone got the above errors ?
@TheJaniczek
@TheJaniczek 6 жыл бұрын
Sorted, hLogo was of wrong type.
@Shanks_Almoshakis
@Shanks_Almoshakis 7 жыл бұрын
Nice
@castardio
@castardio 6 жыл бұрын
عرب مطورين هنا
@daniyar_beishekeev
@daniyar_beishekeev 6 жыл бұрын
Please,give me code!!!
@hydra8583
@hydra8583 5 жыл бұрын
cool
Windows GUI Programming with C/C++ ( Win32 API ) | Part -6 | The Message Box Dialog
16:51
Emulating a CPU in C++ (6502)
52:28
Dave Poo
Рет қаралды 1 МЛН
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 8 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 61 МЛН
My life changing year of C++ game development
3:37
Cakez
Рет қаралды 31 М.
Drawing Graphics with C and Windows API is Easy
5:17
Nir Lichtman
Рет қаралды 39 М.
IPC: To Share Memory Or To Send Messages
14:15
Core Dumped
Рет қаралды 97 М.
Cross Platform Graphical User Interfaces in C++
44:49
javidx9
Рет қаралды 874 М.
Let's Create a Compiler (Pt.1)
1:11:03
Pixeled
Рет қаралды 572 М.
Win32 - Drawing Pixels (C)
20:39
Samuli Natri
Рет қаралды 28 М.
Creating a Window using C++ and Win32 | Tutorial
23:10
Aerideus
Рет қаралды 96 М.
Every Programming Language Ever Explained in 15 Minutes
15:29
Flash Bytes
Рет қаралды 361 М.
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН