Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi everyone!

I would like to start by saying thanks to everyone who takes some time to view this thread and try to help.

I have a task to create application's main window to look very similar to this one:

https://iseb.beograd.gov.rs/Admin/AdminHome.aspx[^].

I need to make the same banner with different text, and buttons very similar as those at the page.

I have tried this using bitmaps and loading them into static controls that had style SS_BITMAP, and have tried with BitBlt(), but since the dimensions of the button are big ( i pass 150 as buttons width and 150 as buttons height in CreateWindow() ) the quality of the picture is awful.

So my question is following:

How would I create those same buttons and banner, using C++ and Win32 ?

I guess GDI will not help, or if it will, please tell me what am I missing?

Should I do it with GDI+, or DirectX ...

What is your advice? What should I use to draw those buttons and banner with same quality of graphic?

If you do decide to offer advice, I would highly appreciate if you would recommend some links / books / code examples ...

Thank you very much.

I work in MS Visual Studio Express 2008, on Windows XP, in C++, using pure WIN32 API.

If any other information is required ( source code or something similar ), please ask for it, I will more than gladly supply it.
Posted
Comments
SoMad 24-May-13 19:25pm    
"There is a problem with this website's security certificate. The security certificate presented by this website was issued for a different website's address."
I am afraid I will not be looking closer at that.

Soren Madsen
MyOldAccount 24-May-13 19:48pm    
It is the website of the Department of Energetics of the Belgrade City, there is no need to panic :)

Thanks for sparing some time to see my question.

Cheers!

1 solution

The quality of the graphics will have more to do with how they're created, bitmap vs vector, how they're scaled realtive to the output, how they're stored lossy or lossless images formats and how good the art work is originally than which API is used to render them.
There's no reason something like the web page you linked to can't be rendered using GDI, GDI+, Direct Draw or any number of 3rd party libraries on top of these.
The biggest factor in choosing which API to use will probably be the level of control over the output you need to achieve your desired appearance vs the ammount of work to produce it.

For example if you use a Web Browser control embedded in a Dialog Window in MFC you could achieve a desktop UI almost identical to the page you linked very easily using HTML and Javascript. It would be slow, use lots of memory and be a pain in the neck to integrate with but fast and relatively easy to create.
If you use DirectX and create your own set of interactive controls from scratch including bidirectional Unicode text support you could be looking at a years work. The upside is you will have totol control and what you get will be lighting fast, responsive and small footprint in comparison.
As my computing teacher used to say, "It's swings and roundabouts", or in American "You pays your money and you takes your choice."
 
Share this answer
 
Comments
MyOldAccount 24-May-13 19:43pm    
The bitmaps I have are made in paint, or were converted online from PNG.

They look fine when my buttons are small, but bad when size of the button is increased.

I would be satisfied with the solution you suggested: changing the quality of the bitmaps, thus, leaving my code untouched.

Is this possible?

Can you offer some more advice please?

By the way, thank you for your reply, I greatly appreciate it!
Matthew Faithfull 24-May-13 19:54pm    
There's no general solution to this if you use static images from resources. Someone will always have a display big enough or small enough to make them look awful even if you spend a lot of time working in fancy scaling algorithms.

The solution is often sadly to work harder not smarter and write code to draw the bitmaps rather than doing it yourself. The code can take into account the target environment, i.e. how big they really need to be at runtime and how many colours are being used with current display settings although this is seldom an issue anymore.

There is a compromise case where you use code to scale, tile and assemble small hand drawn or photgraphic bitmaps to form the larger ones for display, rather like using textures in Direct X. This is hard to get right but probably produces the best combination of graphical quality and performance.

Entirely code draw, rectangle at a time, pixel at a time GUIs scale perfectly but tend to be seriously dull. Static graphic GUIs assembled from bitmaps and photos can be very cool but don't scale at all. In fact they seldom look good anywhere except on the machine where the were developed.
MyOldAccount 24-May-13 20:26pm    
Well, I just have to make buttons and banner look like that.
I would like to stick with the GDI.
Is there any way I can achieve the quality of graphics as the one on the web page using GDI and bitmaps?
You have mentioned vectors, would they be more beneficial for my goal?
I just have to make it look good, I am not making movie graphics effects here :)
By the way, buttons and banner should have fixed dimensions, that should be helpful for me, right?
Matthew Faithfull 25-May-13 5:08am    
You can stick with GDI. If your buttons and banner are a fixed size then use bitmaps the same pixel size as your final display and they should look exactly as they do in paint. Vector graphics, like meta files, are good when you need to scale things dynamically but not needed for fixed dimensions.
Final tip. The hardest and longest job with any GUI is adjusting it to make it look right. This always takes lots of cycles and should involve the whole team. Expensive and annoying but worth it when you get it right.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900