void BuildIrred(GF2X& f, long n) { if (n <= 0) Error("BuildIrred: n must be positive"); if (NTL_OVERFLOW(n, 1, 0)) Error("overflow in BuildIrred"); if (n == 1) { SetX(f); return; } GF2X g; _ntl_ulong i; i = 0; do { ConvertBits(g, 2*i+1); SetCoeff(g, n); i++; } while (!IterIrredTest(g)); f = g; }
void AMyImage::LoadFromResource(HINSTANCE hInstance,int nResID,Image_Type it,const ACHAR* ResType) { HRSRC h = FindResource(hInstance,MAKEINTRESOURCE(nResID), ResType); int nFormat = 0; if( it == IMAGE_BMP ) nFormat = CXIMAGE_FORMAT_BMP; else if( it == IMAGE_JPG ) nFormat = CXIMAGE_FORMAT_JPG; else if( it == IMAGE_PNG ) nFormat = CXIMAGE_FORMAT_PNG; m_Image.LoadResource(h,nFormat,hInstance); ConvertBits(); ToTransparent(); }
void AMyImage::LoadBitmap(HBITMAP hBmp) { m_Image.CreateFromHBITMAP(hBmp); ConvertBits(); ToTransparent(); }
void AMyImage::LoadIcon(HICON hIcon) { m_Image.CreateFromHICON(hIcon); ConvertBits(); ToTransparent(); }
void AMyImage::LoadFromFile(const AString& sFileName) { m_Image.Load(sFileName.Text()); ConvertBits(); ToTransparent(); }