Originally posted by: GESYSOP
How can I set a control font with the new
GDI PLUS, WM_SETFONT uses a handle to HFONT......
I will like to do it with GDI PLUS......
Originally posted by: Brad Fish
I seem to be having a problem with using the new operator to allocate GDI+ objects. By stepping through the code, I've discovered that GDI+ does use a specialized new operator, that simply does this:
return DllExports::GdipAlloc(in_size);
The funny thing is that no matter what happens, this function returns NULL, so any subsequent calls I make on my GDI+ objects result in access violations. The code is simple:
void MainFrame::OnPaint (void)
{
PAINTSTRUCT ps;
CDC *dc;
//Begin painting
dc = BeginPaint(&ps);
Graphics *graphics = new Graphics(dc->m_hDC);
SolidBrush *brush = new SolidBrush(Color(128, 0, 0, 255));
graphics->DrawString(L"Hello!", -1, font, PointF(10.0f, 20.0f),
brush);
delete brush;
delete graphics;
//End painting
EndPaint(&ps);
}
If I create all of my GDI+ objects on the stack it works fine, obviously since it's not using the new operator. Any suggestions? I would appreciate an e-mail if that's possible. Thanks in advance.
Originally posted by: richard
Dears,
I get unexpected behavior of GDI+, when I work with a GIF image, which one has a one bit per pixel or four bits per pixel. There is a method GetPixelFormat() of class Image. The metod returns value PixelFormat8bppIndexed for the image. Do I miss something?
Thank you for answer,
Richard
Originally posted by: Michael
Why after I added "gdiplus.h" in my application and compiling results errors (listed below):
(I use Windows XP. Can you help, thanks)
c:\maos_1\gdiplus\includes\gdiplusinit.h(39) : error C2065: 'ULONG_PTR' : undeclared identifier
c:\maos_1\gdiplus\includes\gdiplusinit.h(39) : error C2065: 'token' : undeclared identifier
c:\maos_1\gdiplus\includes\gdiplusinit.h(39) : error C2165: 'left-side modifier' : cannot modify pointers to data
c:\maos_1\gdiplus\includes\gdiplusinit.h(39) : error C2071: 'NotificationHookProc' : illegal storage class
c:\maos_1\gdiplus\includes\gdiplusinit.h(40) : error C2146: syntax error : missing ')' before identifier 'token'
c:\maos_1\gdiplus\includes\gdiplusinit.h(40) : error C2165: 'left-side modifier' : cannot modify pointers to data
c:\maos_1\gdiplus\includes\gdiplusinit.h(40) : error C2071: 'NotificationUnhookProc' : illegal storage class
c:\maos_1\gdiplus\includes\gdiplusinit.h(40) : error C2059: syntax error : ')'
c:\maos_1\gdiplus\includes\gdiplusinit.h(91) : error C2059: syntax error : 'const'
c:\maos_1\gdiplus\includes\gdiplusinit.h(97) : error C2146: syntax error : missing ')' before identifier 'token'
c:\maos_1\gdiplus\includes\gdiplusinit.h(97) : warning C4229: anachronism used : modifiers on data are ignored
c:\maos_1\gdiplus\includes\gdiplusinit.h(97) : error C2182: 'GdiplusShutdown' : illegal use of type 'void'
c:\maos_1\gdiplus\includes\gdiplusinit.h(97) : error C2059: syntax error : ')'
Originally posted by: diforn
when i use gdi+
when compile,here come so many error,why?help me pls
d:\microsoft visual studio\vc98\include\gdiplusimaging.h(21) : error C2065: 'ImageFormatUndefined' : undeclared identifier
d:\microsoft visual studio\vc98\include\gdiplusimaging.h(21) : error C2501: 'DEFINE_GUID' : missing storage-class or type specifiers
d:\microsoft visual studio\vc98\include\gdiplusimaging.h(21) : error C2078: too many initializers
d:\microsoft visual studio\vc98\include\gdiplusimaging.h(22) : error C2065: 'ImageFormatMemoryBMP' : undeclared identifier
d:\microsoft visual studio\vc98\include\gdiplusimaging.h(22) : error C2501: 'DEFINE_GUID' : missing storage-class or type specifiers
d:\microsoft visual studio\vc98\include\gdiplusimaging.h(22) : error C2374: 'DEFINE_GUID' : redefinition; multiple initialization
d:\microsoft visual studio\vc98\include\gdiplusimaging.h(21) : see declaration of 'DEFINE_GUID'
.....................
Reply
Originally posted by: pherweg
Hi,
do you have any experience using GDI+ in order to load a tiff image and save it as gif or bmp?
I tried following code and GDI+ saves an empty (white) image. When i use bmp or gif as source image it works fine.
int main(int argc, char* argv[])
{
GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
Image *Im= new Image(L"c:\\test.tiff", FALSE);
CLSID GifCodec;
GetCodecClsid(L"image/bmp", &GifCodec);
Im->Save(L"c:\\test2.bmp", &GifCodec, NULL);
delete Im;
GdiplusShutdown(gdiplusToken);
return 0;
}
Do i miss something?
Bye
Peter
Originally posted by: balaG
When I visit the update site for GDI the Sdk update ActiveX conrol installs and runs on my system.Then the components of core SDK around 11Mb start downloading .After a few hours the progress bar is struck in the same position.
I tried to update to windows installer 2.0 on WIN98
Visual Studio Enterprise edition.Can anyone help me with this?.
Originally posted by: Kallol Chaudhuri
How do I create an instance of Image class in GDI+ from a Device Independent Bitmap or rather from a BITMAPINFOHEADER object?
ReplyOriginally posted by: philip cunningham
I've loaded a Bitmap from file and this works gret but the drawing is sooooo slow and it does not allow the SRCAND parameter which I need.
Wherever I look I cannot find a simple way of accessing the Bitmap object so that I can use StretchDIBits which gives all the speed and flexibility I need
Does anyone know a simple way of doing this - is it possible?
Regards
Phil
Originally posted by: mary
how to convert a jpg into a fax file.
thanks for reply.