Solved

making 1 bitmap out of X bitmaps..

Posted on 2000-04-16
7
220 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:kishk91
Comment Utility
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
Comment Utility
Just one more thing...
Its obvious that i need to do it via code...
;-)
0
 
LVL 10

Expert Comment

by:RONSLOW
Comment Utility
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
Comment Utility
Thank you very much for your kind help...
Best regards
kishk
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 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

11 Experts available now in Live!

Get 1:1 Help Now