Cutting a BMP file to two BMP file

Hi

Can you please let me know how Can I cut a BMP file to 2 Bitmap file.
I do not want to change the widht of file but yes I wish to split the
height.

Do I need to just copy the bits and it will get done?

Thanks
Anup
0
9/16/2008 9:20:17 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
618 Views

Similar Articles

[PageSpeed] 15

On Sep 16, 2:20=A0pm, Matrixinline <anup.kata...@gmail.com> wrote:
> Hi
>
> Can you please let me know how Can I cut a BMP file to 2 Bitmap file.
> I do not want to change the widht of file but yes I wish to split the
> height.
>
> Do I need to just copy the bits and it will get done?
>
> Thanks
> Anup

Create a new bitmap of desired size and copy the required bits using
StretchBlt function. Please check MSDN for more information
http://msdn.microsoft.com/en-us/library/ms532355(VS.85).aspx
0
CSarath (7)
9/16/2008 9:30:35 AM
Here is how I would do it:

#include <atlimage.h>

void SplitImage()
{
   CImage Image;
   Image.LoadFromResource(AfxGetInstanceHandle(),IDB_BITMAP1);

   CImage UpperImage;
   UpperImage.Create(Image.GetWidth(),Image.GetHeight()/2,Image.GetBPP());

   HDC hdc = UpperImage.GetDC();
   Image.BitBlt(hdc,0,0,Image.GetWidth(),Image.GetHeight()/2,0,0);
   UpperImage.ReleaseDC();

   UpperImage.Save("UpperPart.bmp",Gdiplus::ImageFormatBMP);

   CImage LowerImage;
   LowerImage.Create(Image.GetWidth(),Image.GetHeight()/2,Image.GetBPP());

   hdc = LowerImage.GetDC();
   Image.BitBlt(hdc,0,0,Image.GetWidth(),Image.GetHeight()/2,0,Image.GetHeight()/2);
   LowerImage.ReleaseDC();

   LowerImage.Save("LowerPart.bmp",Gdiplus::ImageFormatBMP);

}

AliR.



"Matrixinline" <anup.kataria@gmail.com> wrote in message 
news:298564c7-75d2-46ed-80d9-8bfa40cea879@s28g2000prd.googlegroups.com...
> Hi
>
> Can you please let me know how Can I cut a BMP file to 2 Bitmap file.
> I do not want to change the widht of file but yes I wish to split the
> height.
>
> Do I need to just copy the bits and it will get done?
>
> Thanks
> Anup 


1
AliR3470 (3235)
9/16/2008 2:37:00 PM
Reply:

Similar Artilces:

Short cuts?
Is there a way to get excel in a macro to put a shortcut to the current file on to the desktop? Thanks in advance Greg Hi Greg, Here is some code Sub CreateShortCut() Dim oWSH As Object Dim oShortcut As Object Dim sPathDeskTop As String Set oWSH = CreateObject("WScript.Shell") sPathDeskTop = oWSH.SpecialFolders("Desktop") Set oShortcut = oWSH.CreateShortCut(sPathDeskTop & "\" & _ ActiveWorkbook.Name & ".lnk") With oShortcut .TargetPath = ActiveWorkbook.FullName .Save End With Set oWSH = Nothing...

form cache file not valid
I receive the following error message when trying to email from the internet... does it say frmcache.dat? if so, delete it and it will recreate the frmcache.dat when you reopen outlook. -- Robert Cohen A legend in his own mind -- <anonymous@discussions.microsoft.com> wrote in message news:1371401c3f725$6b989c00$a501280a@phx.gbl... > I receive the following error message when trying to email > from the internet... ...

Excell
Can anyone help - Im finding that if i Cut an entire row which has cells in it that hve Conditional Formatts and Insert that row elsewhere in a workbook that the conditional formatts get all messed up, this seems to be a glich with Excel 2000 - does any one know of any fixes - it doesnt do the same think in Excel XP. Please email me if you can help or know how i can ask microsoft direct without it costing me a fortune Jim, My guess is that the Conditional Formatting is using a formula rather than a cell value. It may be the relative/absolute cell references in the formulas. Give de...

how to open publisher 2003 files in publisher 2000
i have files created on a friend's maching with publisher 2003. i have publisher 2000 on my machine, and am unable to open the files. receive message to the effect that "publisher can't open files from a previous verison". help! Your friend can save the document as a 2000 file. Have her/him resend it to you. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "djg" <djg@discussions.microsoft.com> wrote in message news:8F67D02F-C409-4957-A17C-3280724F1ECB@microsoft.com... >i have files created on...

.pst file will not import
Aloha, Last week our old hard drive crashed. I did have all my outlook emails backed up on a disk .pst because this is my business. The new hard drive is installed as are all the programs. Outlook 2003 Small Business (which we also used last time) is up and running fine. I now need to import these emails, notes, calendar, etc from the disk. I have read NOT to use the Import function in Outlook but to copy the files to the hard drive. It seems the files have "Read-only" checked. When I go to uncheck and click apply an error message comes up stating "An error occured ...

Insereting .png files
Outlook 2003, of Office Pro 2003 - When I want to insert a .png photo, the dialog box always displays .gif,.jpg files in the folder. I always have to change the file mask to "All Files" to see my .png file. What is the registry setting that controls the default file mask so I can add .png ? Thanks. -Ric Just typ *.png in the box -- Robert Sparnaaij [MVP-Outlook] www.howto-outlook.com Tips of the month: -Navigation Pane Tips & Tricks -Create an Office XP CD slipstreamed with Service Pack 3 "Richard Fink" <rfink@worldpassage.net> wrote in message news:eN...

Sort winners of a golf tournament two ways
In a golf tournament, we have two groups of winners. One group is those players with the lowest gross scores. The second group is those players with the lowest net (gross minus handicap) scores. In the example, 3 players would be rewarded for their highest finish, be it gross or net. They cannot win a prize in both categories. Example: Name Hdc Gross Scr Net Scr Gross Rank Net Rank Bob 12 87 75 6 6 Carl 6 78 72 2 4 Ed 17 ...

Export Global Group Members samacountname(s) to Text File
Hi I need to take the members of a global group and export their samaccountnames. I'm sure this isn't a huge task. Can someone advise on the least painless way to do this - i am in the middle of a 3000 user migration and need a quick fix! Cheers "Stuscotland" <Stuscotland@discussions.microsoft.com> wrote in message news:38950585-04CF-4551-B39B-5E5BCE6AC15F@microsoft.com... > Hi > I need to take the members of a global group and export their > samaccountnames. I'm sure this isn't a huge task. Can someone advise on > the &g...

restoring Backup file and money file
Hi, I have a problem restoring my backup file. I was playing with money and was attempting to create a new budget. They told me to create a new budget I would have to save my old one. I clicked canel in hope it would not bother to create a new budget but instead it ereased my previous budget and created a new one. So I applied the back up file an it works fine. However, when I do Internet Updates all my accts disappear. I believe in restoring a backup, it creates a new money file if eth original does not exists. I still don't understand why only when I do Internet Updates all my ...

Envelopes will not print from computer files as envelopes !
Hi, I just stared to have this problem yesterday and have spent all yesterday and this morning going through all the on screen troubleshooting for this problem! When I pull up my existing envelopes, (all 12 of them) they print out like a letter head instead as a envelope!! When I pull down the print preview, it shows the envelope as a letter head form on a standard 8.5 x 11 sheet! Tried everything that was suggested, but nothing works! Please help me!! Thank you; -- Artus4u What version Publisher? What size are your envelopes? Are you using mail merge? If you are using mail merge y...

Text being cut off
Hello - I have a portrait folded card (tent card) that I am using to make place settings. The name of the person is in a text box at the bottom of the page as normal, then at the top the text box is rotated so that the name is upside down -this way when the card is folded in half the name is rightside up on both sides. The text in the box that is upside down is being barely cut off when I print, just as if the top third is being shaved away straight across. Is this a publisher issue because the text is flipped or could it be my printer? thank you! It is the limitation of your printer...

cut & paste with short cut keys (ctrl C V) with absolute cell refe
How do I cut & paste in Excel with short cut keys (ctrl C V) but maintain absolute cell references rather than it always keeping relative references Hi use a cell reference such as $A$1 -- Regards Frank Kabel Frankfurt, Germany "Modeller Dave" <Modeller Dave@discussions.microsoft.com> schrieb im Newsbeitrag news:285C1268-78E0-4BF9-80C6-D6D7DE97ACDD@microsoft.com... > How do I cut & paste in Excel with short cut keys (ctrl C V) but maintain > absolute cell references rather than it always keeping relative references ...

Deleting Files
This is my first experience with Excel and am having a problem trying to delete files that I no longer need. I have tried to follow the instructions presented in the Help section: identify, right click and delete, but when I right click, an options menu does not appear, thus I cannot click on delete. Any help on this would be appreciated. Thanks -- Ben Dover May we assume that you are using FILE>OPEN >click on file(s)>right click >delete -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com "Ben Dover" <BenDover@discussions.m...

Filing away posting Journals
I am wondering according to which number i should file away my posting journals in GL,PM,RM,BM I need a consistent filing system for my client,since he doesn't like the fact that GP has no auto batch number. another question: how can i trace a paybles transaction from payables to GL in Payables Management (in other words i want to see the gl transaction from payables) Thanks ...

Memo field last line cut off in print preview, not in report view
I have created a report that includes a memo field. Can grow is enabled. In Report view, it is fine, shows all the memo field info. However, in print preview, it cuts off the last line. Access 2007 Any help would be greatly appreciated. Rick ...

File will not open
I am suddenly having difficulty opening an excel file in Windows ME. It gets to the point where it is almost open when the dreaded black screen appears. Other excel files give no problem opening. The problem file is 56mb in size, I cannot remember, what is the limit an excel file can be? The same file is also contained on another computer running WindowsXP and will open ok. Any thoughts to what might be the problem? Thankyou in advance Pat ...

importing Excel file into Outlook Contacts
I am trying to import an Excel file into Outlook 2002. I did this successfully 1 time but now when I get to the "Import a File" - "The following actions will be performed" dialoge box, I can not change the file to the new file I want to import. The first one I Imported continues to be listed and I can't get rid of it. What should I do??? I experienced the same and the problem was solved when I reboot... You have to reboot... >-----Original Message----- >I am trying to import an Excel file into Outlook 2002. I >did this successfully 1 time but now...

Two at once??
Hi I would like to be able to see the contents of 2, or even better 3, mail folders when I open Outlook rather than just the one at present. Ideally one above the other. Any ideas that could help me. Thanks Right click on a folder and choose "Open in a new window". Then right click on the taskbar & choose "Tile Windows Horizontally" "Zaphod" <zaphodbeeb@ntlworld.com> wrote in message news:hZFLe.8727$wh6.2887@newsfe2-win.ntli.net... > Hi > > I would like to be able to see the contents of 2, or even better 3, mail > folders when I ...

Updating Files
Hi. I have a quick question about updating file. I have a workbook which has links to other workbooks. When I open the main workbook it asks me if I want to update the links. Can anyone tell me if the other workbooks have to be open in order for the updates to take place or if it will find the data without opening the other workbooks. Thanks. Liz. No, the "sending" workbooks don't have to be open. But if you have lots of links, you may find it faster to open those sending workbooks first. You can do a few experiments to test. BoRed79 wrote: &g...

Saving files in from Outlook
How do you change the default folder to save files from the temp folder to the my documents when you open/save a Word of Excel document that you received as an attachement. Melinda, I believe this needs to be changed in Excel and Word not Outlook. Meaning this will change your default location for all documents. In Excel - Tools- Options choose the General Tab. - You will see a path called the "default location" Change it to where you would like the default to ve. Word - Tools Options - File Locations - choose Docuements - then click modify if you wish to change it. R...

Same class file for Win and Web
Hi I've a very simple class file with a number of static methods that I need to call from both a Windows app and a Web app. I dont want to build seperate dll's for these projects. The code should just be a part each project. I've tried in studio to add the .cs file to each project but instead of a reference to the same file the .cs file is copied to each project directory. Any help would be appreciated,- thanks. Peter Hello, > I dont want to build seperate dll's for these projects. The code should > just be a part each project. I've tri...

Multiple PST files in backed up data.
In the process of restoring my backup PST files I noticed that there are several files with PST extensions. The one that I thought was the main one (outlook.pst) has a date of 6/7/2003. I use numerous folder and email accounts and I used MS Windows XP Pro Backup program to back up all my Documents and Settings files. There are about 8 PST files in the backup, but none seem to be correct although some have recent dates vs the June date for the Outlook.pst file. Could it be that the program did not back up my Outlook files correctly?? Any other possibilities?? Thanks much for any...

Unexpected error message on closing an Excel file
Suddenly I am getting the following message when I try to close a workbook: "Your formula contains an invalid external reference to a worksheet. Verify that the path, workbook, and range name or cell reference are correct, and try again" The mysterious thing is that it does not happen consistently and that, after I click OK after the above message, I can still save the file. What might be the cause of this error message and can the "invalid reference" be tracked down using one of the utility add-ins such as J. Walkenbach's PUP? If it only happens when you close ...

Cut Paste Pages
how do I cut or copy pages out of one publisher document into another document? JD wrote: > how do I cut or copy pages out of one publisher document into another > document? Open both documents, copy from one paste in the other, select whichever under Window. -- -- Geoff ExploitEd Wisdom and experience come with age, they say, but I do wish I could remember the darn question ...

Create random file
Hi, I wish create a large random file (for testing copy in powershell between servers on WAN) i'm using a get-random function but it's very slow. A file can have a size of 1-5 Gb Do you have ideas for accelerate this program? Thanks and happy new year. My tiny program function GenChaine([int]$n) # G�n�ration d'une chaine al�atoire de n caract�res { $caracteres = "a|z|e|r|t|y|u|i|o|p|q|s|d|f|g|h|j|k|l|m|w|x|c|v|b|n" $caracteres += "A|Z|E|R|T|Y|U|I|O|P|Q|S|D|F|G|H|J|K|L|M|W|X|C|V|B|N" $caracteres += "0|1|2|3|4|5|6|7|8|9&...