Click here to Skip to main content
15,917,454 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: LNK2001 error Pin
Chris Meech21-Oct-03 7:59
Chris Meech21-Oct-03 7:59 
GeneralDisappearing list controls Pin
JT Anderson21-Oct-03 6:14
JT Anderson21-Oct-03 6:14 
GeneralRe: Disappearing list controls Pin
igor196021-Oct-03 8:51
igor196021-Oct-03 8:51 
GeneralRe: Disappearing list controls Pin
JT Anderson21-Oct-03 9:17
JT Anderson21-Oct-03 9:17 
GeneralRe: Disappearing list controls Pin
David Crow21-Oct-03 10:02
David Crow21-Oct-03 10:02 
GeneralRe: Disappearing list controls Pin
JT Anderson21-Oct-03 10:38
JT Anderson21-Oct-03 10:38 
Questionhow to split a bitmap into multiple bitmaps and save them to a folder Pin
Slim Gradey21-Oct-03 5:49
Slim Gradey21-Oct-03 5:49 
AnswerRe: how to split a bitmap into multiple bitmaps and save them to a folder Pin
John R. Shaw21-Oct-03 17:14
John R. Shaw21-Oct-03 17:14 
Spilling a bitmap into multiple parts is the easy part, so I'll address that.

If you are going to spilt the bitmap into equal parts then it is simply a matter of creating 1 bitmap for each part and then blitting from the origanal to the new bitmap.

Example:
        (0,0)   (100,0)     (200,0)
        +-----------+-----------+
        |           |           |
        | part 1    | part 2    |
        |           |           |
(0,100) +-----------+-----------+ (200, 100)
        |           |           |
        | part 3    | part 4    |
        |           |           |
(0,200) +-----------+-----------+ (200,200)
1) Create compatible bitmap 1 (100, 100)
   part1.blit(0,0,100,100,hdcSource,0,0)
2) Create compatible bitmap 2 (100, 100)
   part2.blit(0,0,100,100,hdcSource,100,0);
3) Create compatible bitmap 3 (100, 100)
   part3.blit(0,0,100,100,hdcSource,0,100);
4) Create compatible bitmap 4 (100, 100)
   part4.blit(0,0,100,100,hdcSource,100,100);

Now you have 4 bitmaps that only contain a part of the origanal.


The trick is saving them to disk!

You can start with by searching for dibsection (and GetDIBits()) in MSDN and at codeproject, codeguru, and sourceforceforge. To use dibsection (or GetDIBit()) you will need to use CBitmap:Bitmap() or ::GetObject(pBmp,sizeof(BITMAP)) and do some calculations in order to figure out what the BITMAPFILEHEADER and BITMAPINFOHEADER will need to contain in order to save the file.

Note: GetDIBits() is your best bet. All you need to to do is create a BITMAPINFOHEADER and pass it to GetDIBits() let it fill in the BITMAPINFOHEADER for you, then let it calculate the amount of storage needed for the image (pixel bits) then call it again to retrieve the image. Then create the BITMAPFILEHEADER and write the results to disk. In reality it's a bit more complicated, but a search of MSDN and the WEB should ease you burdon.

I leave the rest up to you! Search MSDN on how to use GetDIBits().


INTP
GeneralCbutton Pin
act_x21-Oct-03 5:30
act_x21-Oct-03 5:30 
GeneralRe: Cbutton Pin
Steve S21-Oct-03 5:41
Steve S21-Oct-03 5:41 
GeneralRe: Cbutton Pin
act_x21-Oct-03 5:48
act_x21-Oct-03 5:48 
GeneralRe: Cbutton Pin
John R. Shaw21-Oct-03 17:28
John R. Shaw21-Oct-03 17:28 
GeneralRe: Cbutton Pin
DaFrawg26-Oct-03 3:09
DaFrawg26-Oct-03 3:09 
QuestionLPTSTR? Pin
badsmonkey21-Oct-03 5:16
badsmonkey21-Oct-03 5:16 
AnswerRe: LPTSTR? Pin
Steve S21-Oct-03 5:39
Steve S21-Oct-03 5:39 
AnswerRe: LPTSTR? Pin
badsmonkey21-Oct-03 5:55
badsmonkey21-Oct-03 5:55 
GeneralRe: LPTSTR? Pin
David Crow21-Oct-03 8:14
David Crow21-Oct-03 8:14 
GeneralRe: LPTSTR? Pin
badsmonkey21-Oct-03 9:03
badsmonkey21-Oct-03 9:03 
GeneralRe: LPTSTR? Pin
David Crow21-Oct-03 9:40
David Crow21-Oct-03 9:40 
GeneralRe: LPTSTR? Pin
Michael Dunn21-Oct-03 9:26
sitebuilderMichael Dunn21-Oct-03 9:26 
GeneralHi ! How can we call .Net Web Service method from C++ Client Pin
Abhishek Avasthi21-Oct-03 4:56
Abhishek Avasthi21-Oct-03 4:56 
GeneralRe: Hi ! How can we call .Net Web Service method from C++ Client Pin
Xiangyang Liu 刘向阳21-Oct-03 5:13
Xiangyang Liu 刘向阳21-Oct-03 5:13 
GeneralRe: Hi ! How can we call .Net Web Service method from C++ Client Pin
igor196021-Oct-03 11:42
igor196021-Oct-03 11:42 
GeneralRe: Hi ! How can we call .Net Web Service method from C++ Client Pin
Abhishek Avasthi23-Oct-03 2:10
Abhishek Avasthi23-Oct-03 2:10 
GeneralRe: Hi ! How can we call .Net Web Service method from C++ Client Pin
Abhishek Avasthi23-Oct-03 2:10
Abhishek Avasthi23-Oct-03 2:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.