Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

making 1 bitmap out of X bitmaps..

Posted on 2000-04-16
7
Medium Priority
?
227 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 300 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

824 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