Skip to content

Commit

Permalink
bitmap.cpp, bitmap.h: translation
Browse files Browse the repository at this point in the history
  • Loading branch information
majklvi authored and janrysavy committed Dec 15, 2023
1 parent a28afcb commit 1065fac
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions src/bitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ BOOL CBitmap::CreateBmpBW(int width, int height)
return TRUE;
}

// vytvori bitmapu kompatibilni s DC
// creates a DC compatible bitmap
BOOL CBitmap::CreateBmp(HDC hDC, int width, int height)
{
if (HBmp != NULL)
Expand Down Expand Up @@ -128,7 +128,7 @@ BOOL CBitmap::CreateBmp(HDC hDC, int width, int height)
if (releaseDC)
HANDLES(ReleaseDC(NULL, hDC));

// vytahnu informace pro pozdejsi upravy
// fetch information for later changes
BITMAP bmp;
GetObject(HBmp, sizeof(bmp), &bmp);
Planes = bmp.bmPlanes;
Expand Down Expand Up @@ -179,7 +179,7 @@ BOOL CBitmap::ReCreateForScreenDC(int width, int height)
Width = width;
Height = height;

// vytahnu informace pro pozdejsi upravy
// fetch information for later changes
BITMAP bmp;
GetObject(HBmp, sizeof(bmp), &bmp);
Planes = bmp.bmPlanes;
Expand Down Expand Up @@ -217,10 +217,10 @@ BOOL CBitmap::Enlarge(int width, int height)
width = Width;
if (Height > height)
height = Height;
// pokusim se vytvorit vetsi bitmapu
// !POZOR! Sal 2.5b6 byla pomala pri paintu do Vieweru (PgDn) proti 2.0
// Bylo to tim, ze jsme vytvareli cache pres CreateBitmap() misto pres CreateCompatibleBitmap()
// Podle MSDN se ma pouzivat CreateBitmap() pouze pro vyvareni B&W bitmap.
// try to create a larger bitmap
// !CAUTION! Sal 2.5b6 was slow when painting to Viewer (PgDn) compared to 2.0
// Caused by creating the cache with CreateBitmap() instead of CreateCompatibleBitmap()
// According to MSDN, CreateBitmap() should only be used for B&W bitmaps.
HBITMAP hTmpBmp;
if (HMemDC == NULL || BlackAndWhite)
{
Expand Down
20 changes: 10 additions & 10 deletions src/bitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,24 @@ class CBitmap
CBitmap();
~CBitmap();

// destukce bitmapy i DC
// destruction of both bitmap and DC
void Destroy();

// vytvori bitmapu kompatibilni s DC (pokud je hDC==NULL, bude kompatibili s obrazovkou)
// creates a DC compatible bitmap (will be compatible with screen, if hDC==NULL)
BOOL CreateBmp(HDC hDC, int width, int height);
// vytvori bitmapu
// creates a bitmap
BOOL CreateBmpBW(int width, int height);
// nacte bitmapu z resource (pujde o DDB kompatibilni s obrazovkou)
// loads a bitmap from resource (DDB will be compatible with the screen)
BOOL CreateBmpFrom(HINSTANCE hInstance, int resID);
// pokud doslo ke zmene barevne hloubky obrazovky, je treba znovu vytvorit bitmapu
// rozmery se upravi jen na vetsi a vybrane handly zustanou zachovany; bitmapa bude
// kompatibilni s obrazovkou
// if a change of the screen color depth occurs, the bitmap has to be created again
// dimensions will be just adjusted to larger ones and the selected handles will be kept; the bitmap
// will be compatible with the screen
BOOL ReCreateForScreenDC(int width = -1, int height = -1);

// zvetsi bitmapu na pozadovanou velikost; pokud je uz bitmapa dostatecne
// velika, nezmensuje ji - pouze vrati TRUE
// enlarges the bitmap to desired size; if the bitmap is large enough already, it won't
// be shrinked - just returns TRUE
BOOL Enlarge(int width, int height);
// vrati TRUE, pokud je treba bitmapu zvetsit
// returns TRUE, if the bitmap needs to be enlarged
BOOL NeedEnlarge(int width, int height);

DWORD GetWidth() { return Width; }
Expand Down

0 comments on commit 1065fac

Please sign in to comment.