Solved

making 1 bitmap out of X bitmaps..

Posted on 2000-04-16
7
221 Views
Last Modified: 2013-11-20
Hi there..
Imagine that you have 3 bitmaps.
1 bitmap is the top of the drawing. the second bitmap is the bottom of the drawing and the  third bitmap is the middle bitmap.
the first 2 is fixed hich mean it will always be in the top and the bottom.
The middle should be added dynamicly.
What im trying to do is somekind of toold bar that the background of it will be this 3 bitmaps..
I need to dynamicly add the middle one according to the number of buttons that i have..
I hope that im clear enough..
Please.. ill appriciate any suggestion..
Many thanks
kishk91


0
Comment
Question by:kishk91
  • 4
  • 3
7 Comments
 
LVL 10

Accepted Solution

by:
RONSLOW earned 75 total points
ID: 2721266
I assume you are responding to OnEraseBkgnd (or similar) to draw the background of you toolbar-like thing.

If so, then you just look at the height, compare it to the 3 bitmaps heights to determine what to display.

If the height is <= the sum of the top and bottom bitmap heights, then you'd either stretchblt to scale them or use BitBlt to copy the appropriate part of each.

If the height is greater, then you'd BitBlt the top and bottom, and either StretchBlt or BitBlt-part-of the middle.
0
 

Author Comment

by:kishk91
ID: 2721556
Hi...
thank you very much for the idea..
Its very acceptable..
But still id like to know if there is possible way to do what i needed?

Thanks again for your help...
Kishk91
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2721645
Well.. what exactly is it you need?

Do you want to combine several bitmaps into 1?  Then just a few StretchBlt/BitBlt calls as above will to the question.

Do you wantto paint several bitmaps onto your dialog/window/whatever?  Then the same thing, but done in your OnEraseBkgnd or OnPaint call (say).

If I'm missing the point of the question, then plesae clarify so I can help you further.

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:kishk91
ID: 2721980
HI..
I know to how the handle OnEraseBkgnd() i use it alot..
im drawing my own windows and creting regions from the bitmaps..
What i asked ijust imagine you have photo shop.. and you open 3 bitmaps..
now you create EMPTY one and copy/paste the others into it...
when youll save it youll have i big bmp that contains the others...
I hope this is cleaere...
Thanks for replying..
kishk
0
 

Author Comment

by:kishk91
ID: 2721990
Just one more thing...
Its obvious that i need to do it via code...
;-)
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2724923
Yes .. you do exactly the same sort of thing to draw onto another bitmap as you do when doing OnEraseBkgnd.

The only difference is that you create the destination bitmap and a compatible DC, then draw into that just as you would in your on erase bkgnd code.

I prefer to use 24bit DIB's for my bitmaps.  There are no problems / extra code to handle palletes, they are easy to create and read/write from/to files etc
0
 

Author Comment

by:kishk91
ID: 2725284
Thank you very much for your kind help...
Best regards
kishk
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Question regarding Copy/Paste 16 91
sum13 challenge 24 90
MaxSpan challenge 9 82
Execute multiple curl cmds with sleep and send output to file 10 89
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now