Originally posted by: Tom
So..Here is my attempt that failed. "a" points to a bitmap that was grabbed from the screen using bitblt.
Bitmap c (a->GetWidth(),
NOTE: If I change the PixelFormat8bppIndexed to PixelFormat24bppRGB it works fine. But with this, "c" is NULL.
Any suggestions?
Hello. I'm haveing an issue converting a bitmap to 256 colors. Really what I would like to do is grab a piece of the screen and convert it to a 256 color bitmap. The whole purpose is to display what a small image would look like on a device with a limited screen size and color depth.
a->GetHeight(),
PixelFormat8bppIndexed);
Originally posted by: chris
everything links and complies ok...but when i try to load an image (jpg or bitmap) the program just crashes. any ideas on why? thx in advance..
Reply
Originally posted by: AQ
Example:
Image *II;
II=new Image(L"");
Compiling...
tttView.cpp
D:\AU\ttt\tttView.cpp(69) : error C2660: 'new' : function does not take 3 parameters
Error executing cl.exe.
what means???
Originally posted by: alex_chew
when i convert a CString to a WCHAR* and then use the var to get a new bitmap ,error displayed:
CString currentFile("test.bmp");
LPTSTR ansiFileName=currentFile.GetBuffer(currentFile.GetLength());
WCHAR* unicodeFileName = new WCHAR[currentFile.GetLength()+1];
MultiByteToWideChar(CP_ACP,0,ansiFileName,strlen(ansiFileName),unicodeFileName,currentFile.GetLength()+1);
Bitmap* tempbmp = new Bitmap(unicodeFileName);//error occur:error c2660 'new':function doesnot take 3 parameters
//but using like below can work well
Bitmap tempbmp(unicodeFileName);
What is wrong here??
Originally posted by: alex_chew
I have it solved. Because MFC has operator new overload,so when you use Gdi+ in a mfc project ,you'd better comment the line #define new DEBUG_NEW .Of course if you build a release version,this is not a problem
ReplyOriginally posted by: ZHEFU ZHANG
Thank you for the MSDN link, but one thing, it runs well in my Win2k, but in WinXp MFC error messagebox pops up. any idea?
Originally posted by: deus
BOOL IntersectsWith(IN const RectF& rect) const
in the gdiplus.zip, gdiplustypes.h
{
return (GetLeft() < rect.GetRight() &&
GetTop() < rect.GetTop() &&
~~~~~~~~~~~~~~~~~~~~~~~~~
GetRight() > rect.GetLeft() &&
GetBottom() > rect.GetTop());
}
Originally posted by: nikki
Got this error when linking. Pls help.
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Originally posted by: asaf ezra
Since I had problems using the new operator on gdi+ objects, I used:
#ifdef _DEBUG
#define SAVED_NEW new
#undef new
#endif
before allocating an Image object.
Now the allocation succeeded but it seems the operation itself didn't come out right, since looking at the allocated Image parameters the nativeImage is 0x00000000 and lastResult is InvalidParameter.
When I simply use ::new Bitmap( filename, FALSE) it comes out right but as mentioned before this object delete will fail.
Thanx in advance,
Asaf
Reply
Originally posted by: Jason You
I want to use the function "GdipCreateBitmapFromScan0" to create a Bitmap object, but I don't know what format of the data buffer pointer "scan0" should be.
Is there anybody who can help me?
Thanks in advance!
Reply