Posts Tagged ‘gdi+

Aslinda tum olay MFC projesinde GDI+ kullanmayla basladi. GDI+ kullanmaya basladiginizda Gdiplus::GdiplusStartup, isiniz bittiginde Gdiplus::GdiplusShutdown fonksiyonlarini cagirmalisiniz. Projede devamli GDI+ kullandigim icin InitInstance() icinde start, ExitInstance() icinde stop yaptim.   //////////////////////////////////////////////////////////////////////////// // GDI+ Start Stop functions ULONG_PTR gdiplusToken; Gdiplus::GdiplusStartupInput gdiplusStartupInput; Gdiplus::GdiplusStartupOutput gdiplusStartupOutput; BOOL StartGdiPlus() { if (Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL)) { MessageBox(NULL, TEXT(“GDI+ failed to start up!”), TEXT(“Error!”), MB_ICONERROR); return FALSE; } return TRUE; } void StopGdiPlus() { Gdiplus::GdiplusShutdown(gdiplusToken); } //////////////////////////////////////////////////////////////////////////// // CActivexApp::InitInstance – DLL initialization BOOL CActivexApp::InitInstance() { BOOL bInit = COleControlModule::InitInstance(); if (bInit) { […]

PNG ve GDI+ hatası

14, Jan 2010

img.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Png); ile A generic error occurred in GDI+ hatası alıyorsanız asağıdaki kodu deneyin MemoryStream ms= new MemoryStream(); Bitmap bitmap = new Bitmap(img); bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png); ms.WriteTo(Response.OutputStream);


top