Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

making 1 bitmap out of X bitmaps..

Posted on 2000-04-16
7
Medium Priority
?
226 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

670 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