Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
i write copied this code but it gives an error. why it does not include the header file?

coding:
C++
#include "BitmapEx.h"

// Load bitmap
CBitmapEx bitmapEx;
bitmapEx.Load(_T("Enter bitmap source file path here..."));

// Do whatever you need to do here

bitmapEx.Rotate(45);
bitmapEx.Sepia();
bitmapEx.Scale(50, 50);

// Draw the results on the screen (get hDC somewhere else)
bitmapEx.Draw(hDC);

// Save bitmap
bitmapEx.Save(_T("Enter bitmap destination file path here..."));


error:
Cannot open include file: 'BitmapEx.h': No such file or directory
Posted
Updated 23-Jun-10 8:52am
v2
Comments
Sandeep Mewara 23-Jun-10 13:46pm    
Does that file exists in your directory?
Sweety Khan 23-Jun-10 14:01pm    
may be not. how can i check this that it exist or not? and how can i load it in the directory?
Sweety Khan 24-Jun-10 5:02am    
i mean the same by the word write. it is quite obvious that i copied it.
Richard MacCutchan 24-Jun-10 16:54pm    
hDC undeclared identifier: what is hDC - I assume it is a handle to a device context, are you aware of where it should be defined? If you are asking this question then I suspect you need to study the basics of windows programming. Take a step back to a simple windows app, rather than being concerned with image rendering.
Sweety Khan 25-Jun-10 14:51pm    
ok please give me some link from which i can read this.......

1 solution

I see that CBitMapEx is not MFC but an extra written by a CodeProject member in this article[^]. I presume you have downloaded all the source and put the header file in some directory that Visual Studio is not aware of. Just add the directory to the list of include directories in your project configuration and everything should work fine. Alternatively you could post your question in the forum at the end of the article and the author may be able to help you.
 
Share this answer
 
Comments
Sweety Khan 24-Jun-10 14:33pm    
finally i will able to add the header file. but plz resolve this error
error C2065: 'hDC' : undeclared identifier

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900