Solved

making 1 bitmap out of X bitmaps..

Posted on 2000-04-16
7
222 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
set up trigger (or something) to rename files (starting with ATL) in a linux directory 6 53
dog bark java program 15 94
sum67 challenge 35 97
unix example issues 18 89
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

808 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