void ModalView::SetWindow(int width,int height) { if (width>36) { width=36 ; } ; if (height>26) { height=26 ; } ; left_=20-width/2 ; top_=10-height/2 ; if (top_<2) { top_=2 ; } ClearRect(-1,-1,width+2,height+2) ; SetColor(CD_HILITE2) ; GUITextProperties props ; props.invert_=true ; char line[41] ; memset(line,' ',40) ; line[width+4]=0 ; DrawString(-2,-2,line,props) ; DrawString(-2,height+1,line,props) ; line[1]=0 ; for (int i=0;i<height+2;i++) { DrawString(-2,i-1,line,props) ; DrawString(width+1,i-1,line,props) ; } } ;
void CSoCProjectView::OnDraw(CDC* pDC) { CSoCProjectDoc*pDoc = GetDocument(); ASSERT_VALID(pDoc); if (!pDoc) return; ClearRect(pDC, RGB(255,255,255)); // TODO: 여기에 원시 데이터에 대한 그리기 코드를 추가합니다. CAPTUREPARMS cp; capCaptureGetSetup(pDoc->m_hCamWnd, &cp, sizeof(cp) ); // get the current defaults cp.dwRequestMicroSecPerFrame = 1; // Set desired frame rate cp.fMakeUserHitOKToCapture = FALSE; cp.fYield = TRUE; // we want capture on a background thread. cp.wNumVideoRequested = (WORD) 1; // we may get less than this - no problem cp.fCaptureAudio = FALSE; cp.vKeyAbort = 0; // If no key is provided, it won't stop... cp.fAbortLeftMouse = FALSE; cp.fAbortRightMouse = FALSE; cp.fLimitEnabled = FALSE; // we want to stop cp.fMCIControl = FALSE; capCaptureSetSetup(pDoc->m_hCamWnd, &cp, sizeof(cp) ); }
bool Button::HandleUp() { if (_drawn && _highlighted) { ClearRect(); DrawText(); return true; } return false; }
// Clip aTarget's image to its filter primitive subregion. // aModifiedRect contains all the pixels which might not be RGBA(0,0,0,0), // it's relative to the surface data. static void ClipTarget(nsSVGFilterInstance* aInstance, const nsSVGFE::Image* aTarget, const nsIntRect& aModifiedRect) { nsIntPoint surfaceTopLeft = aInstance->GetSurfaceRect().TopLeft(); NS_ASSERTION(aInstance->GetSurfaceRect().Contains(aModifiedRect + surfaceTopLeft), "Modified data area overflows the surface?"); nsIntRect clip = aModifiedRect; nsSVGUtils::ClipToGfxRect(&clip, aTarget->mFilterPrimitiveSubregion - gfxPoint(surfaceTopLeft.x, surfaceTopLeft.y)); ClearRect(aTarget->mImage, aModifiedRect.x, aModifiedRect.y, aModifiedRect.XMost(), clip.y); ClearRect(aTarget->mImage, aModifiedRect.x, clip.y, clip.x, clip.YMost()); ClearRect(aTarget->mImage, clip.XMost(), clip.y, aModifiedRect.XMost(), clip.YMost()); ClearRect(aTarget->mImage, aModifiedRect.x, clip.YMost(), aModifiedRect.XMost(), aModifiedRect.YMost()); }
bool Button::HandleHeld(int x, int y) { bool inArea = IsInButtonArea(x,y); if (inArea && !_highlighted) { Highlight(); DrawText(); return true; } else if (!inArea && _highlighted) { ClearRect(); DrawText(); return true; } return false; }
// --------------------------------------------------------------------------- // CFepUiLayoutRootCtrl::DrawFrame // Draw moving frame // (other items were commented in a header). // --------------------------------------------------------------------------- // TRect CFepUiLayoutRootCtrl::DrawFrame(const TRect& aFrameRect, TBool aDrawFlag) { //clear shadow when moving TBool updateShadowArea = EFalse; TRect dirtyRect; if(iShadowShown) { ClearRect(iShadowRect); iShadowShown = EFalse; updateShadowArea = ETrue; } TRect bmpRect; TPoint bmpPos; CFbsBitGc* gc = static_cast<CFbsBitGc*>(BitGc()); //draw mask background TRgb maskPenCol = aDrawFlag ? TRgb(KOpaqueColor) : TRgb(KTransparentColor); DrawBackgroundToDevice(aFrameRect,MaskBitmapDevice(), 0, //TRgb(KTransparentColor), TRgb(KOpaqueColor),EFalse); TRgb(KTransparentColor), maskPenCol,EFalse); //draw background TRgb penCor = aDrawFlag ? KRgbBlack : KRgbWhite; TAknsQsnOtherColorsIndex clrIndex; clrIndex = EAknsCIQsnOtherColorsCG9; if ( AknsUtils::AvkonSkinEnabled() ) { AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), penCor, KAknsIIDQsnTextColors, clrIndex ); } DrawBackgroundToDevice(aFrameRect,BitmapDevice(),0,TRgb(KRgbWhite),penCor,EFalse); gc->RectDrawnTo(dirtyRect); if(updateShadowArea) return iShadowRect; else return dirtyRect; }
function DisplayHeader($res) { $width = $res[0]; if (IsNull(gBigHeaderFont)) { gSmallHeaderFont = RegisterThemeFont("smallHeader"); gBigHeaderFont = RegisterThemeFont("bigHeader"); gEmailImage = LoadImage("images\email.png"); } if ($width <= 160) { UseThemeFont(gSmallHeaderFont); ClearRect(0,0,159,6); DisplayTextRight(FormatTime("DDD M.DD.YY"),160,0); DisplayTextRight(FormatTime("hh:NN:SS TT"), 57); // Pretty blatant copy of SirReal's if (GetEmailCount()) { if (IsNull(emailImage)) emailImage = LoadImage("images\email.png"); DrawImage(gEmailImage, 76, 0); } DrawRect(0, 7, 159, 7); }
void IntroScreen() { #define MAX_TITLES 7 #define MAX_CREDIT_LENGTH 400 #define CREDIT_REDFLASH 0 //#define PROMPT_TEXT_SPACE_X_OFFSETFROMLEFT 16 //#define PROMPT_TEXT_SPACE_Y_OFFSETFROMTOP 4 //#define PROMPT_TEXT_WIDTH 46 //#define PROMPT_TEXT_HEIGHT 15 RECT boxrect; int creditcounter; int numevents; int key; int i; char *agencystring = "T H E A G E N C Y"; char * loadingstring ="STANDBY FOR LOGIN..."; char titles[MAX_TITLES][MAX_CREDIT_LENGTH] = { "Every country, whether sooner or later,", "Communication, Expression, Freedom;", "So that the society can better be harnessed", "The United States of America", "Perhaps the greatest testament to secrecy", "Within the dark and silent walls, deep below ground,", "Those who have known its power have respectfully called it..." }; char subtitles[MAX_TITLES][MAX_CREDIT_LENGTH] = { "has had to rely on the strength of secrecy.", "these principles have been silently put aside...", "for the real work to be done.", "is no exception.", "can be found here, in Virginia...", "lies America's most secretive government branch.", "" } ; COORD dutydrawcoords; COORD namedrawcoords; COORD boxsize = {PROMPT_TEXT_WIDTH, PROMPT_TEXT_HEIGHT}; COORD boxstart = {PROMPT_TEXT_SPACE_X_OFFSETFROMLEFT, PROMPT_TEXT_SPACE_Y_OFFSETFROMTOP}; COORD zeroed = {0,0}; LoopSong(globals.musiclist.songs[INTRO_SONG]); boxrect.left = PROMPT_TEXT_SPACE_X_OFFSETFROMLEFT; boxrect.top = PROMPT_TEXT_SPACE_Y_OFFSETFROMTOP; boxrect.right = PROMPT_TEXT_SPACE_X_OFFSETFROMLEFT+PROMPT_TEXT_WIDTH; boxrect.bottom = PROMPT_TEXT_SPACE_Y_OFFSETFROMTOP + PROMPT_TEXT_HEIGHT; for (creditcounter = 0; creditcounter < MAX_TITLES; creditcounter++){ numevents = checkforinput(); if (numevents > 1) { for (i = 1; i <= numevents; i++) { key = getinput(i); if(key == VK_ESCAPE){ FLUSH; clearinputrecords(); return; } } } FLUSH; clearinputrecords(); ClearRect(boxrect); dutydrawcoords = retrieveTextCenter(titles[creditcounter]); dutydrawcoords.Y --; namedrawcoords = retrieveTextCenter(subtitles[creditcounter]); RED; setcursor(dutydrawcoords.X, dutydrawcoords.Y); bufferprint(1, titles[creditcounter]); setcursor(dutydrawcoords.X, dutydrawcoords.Y); LRED; bufferprint(1, titles[creditcounter]); Sleep(1000); RED; setcursor(namedrawcoords.X, namedrawcoords.Y); bufferprint(1, subtitles[creditcounter]); setcursor(namedrawcoords.X, namedrawcoords.Y); LRED; bufferprint(1, subtitles[creditcounter]); Sleep(3500); RED; setcursor(dutydrawcoords.X, dutydrawcoords.Y); printf(titles[creditcounter]); setcursor(dutydrawcoords.X, dutydrawcoords.Y); RED; setcursor(namedrawcoords.X, namedrawcoords.Y); printf(subtitles[creditcounter]); setcursor(namedrawcoords.X, namedrawcoords.Y); Sleep(80); setcursor(namedrawcoords.X, namedrawcoords.Y); cleartext(subtitles[creditcounter]); setcursor(dutydrawcoords.X, dutydrawcoords.Y); cleartext(titles[creditcounter]); Sleep(1000); } dutydrawcoords = retrieveTextCenter(agencystring); RED; setcursor(dutydrawcoords.X, dutydrawcoords.Y); printf(agencystring); LRED; Sleep(150); setcursor(dutydrawcoords.X, dutydrawcoords.Y); printf(agencystring); Sleep(2000); RED; setcursor(dutydrawcoords.X, dutydrawcoords.Y); printf(agencystring); Sleep(150); cls(); dutydrawcoords = retrieveTextCenter(loadingstring); RED; setcursor(dutydrawcoords.X, dutydrawcoords.Y); printf(loadingstring); LRED; Sleep(150); setcursor(dutydrawcoords.X, dutydrawcoords.Y); printf(loadingstring); Sleep(2000); RED; setcursor(dutydrawcoords.X, dutydrawcoords.Y); printf(loadingstring); Sleep(150); cls(); }
void CreditScreen() { #define MAX_DUTIES 21 #define MAX_CREDIT_LENGTH 400 #define CREDIT_REDFLASH 0 #define CREDIT_GREENFADE 1 //#define PROMPT_TEXT_SPACE_X_OFFSETFROMLEFT 16 //#define PROMPT_TEXT_SPACE_Y_OFFSETFROMTOP 4 //#define PROMPT_TEXT_WIDTH 46 //#define PROMPT_TEXT_HEIGHT 15 RECT boxrect; int creditcounter; char duties[MAX_DUTIES][MAX_CREDIT_LENGTH] = { "THE AGENCY", "Based On \"The Agency\" Espionage Universe", "Designer", "Lead Programmer", "Glamour Model", "Box / Manual Design", "Special Thanks To:", "Special Thanks To:", "We Extend A Special Thank You To:", "We Extend A Special Thank You To:", "We Extend A Special Thank You To:", "Vorpal Design Group is a small west-coast game design group centered around the intelligence and military gaming enthusiast.", "The Agency is an original concept created by Charles Cox. For franchising information, and for info on how you can become a part of The Agency Universe, please contact Charles Cox, President of VDG at: [email protected]", "We will be bringing The Agency : Razor One to you in full 3d very soon. Please stay tuned to the company that brings the intelligence and military world to your computer:", "Vorpal", "VDG ", "Charles Cox", "Wyatt Jackson", "Eddy Irwin", "Jennifer Dygert", "THANKS FOR PLAYING!" }; char names[MAX_DUTIES][MAX_CREDIT_LENGTH] = { "RAZOR ONE", "By Charles Cox", "Charles Cox", "Charles Cox", "Charlie \"Flowers\" From Jersey City", "Charles Cox", "Wyatt Jackson (Dr. J)", "\"Fast\" Eddy Irwin From Jersey City", "\"Big\" Bird", "Big \"Bird\"", "Bert \"and\" Ernie", "", "", "", "Design Group", " IS", "President, CEO, Lead Designer", "Programmer", "Programmer / Designer", "Craft Services", "PRESS A KEY TO RETURN." } ; int styles[MAX_DUTIES] = { CREDIT_REDFLASH, CREDIT_REDFLASH, CREDIT_REDFLASH, CREDIT_REDFLASH, CREDIT_REDFLASH, CREDIT_REDFLASH, CREDIT_REDFLASH, CREDIT_REDFLASH, CREDIT_REDFLASH, CREDIT_REDFLASH, CREDIT_REDFLASH, CREDIT_GREENFADE, CREDIT_GREENFADE, CREDIT_GREENFADE, CREDIT_REDFLASH, CREDIT_REDFLASH, CREDIT_REDFLASH, CREDIT_REDFLASH, CREDIT_REDFLASH, CREDIT_REDFLASH, CREDIT_REDFLASH, }; COORD dutydrawcoords; COORD namedrawcoords; COORD boxsize = {PROMPT_TEXT_WIDTH, PROMPT_TEXT_HEIGHT}; COORD boxstart = {PROMPT_TEXT_SPACE_X_OFFSETFROMLEFT, PROMPT_TEXT_SPACE_Y_OFFSETFROMTOP}; COORD zeroed = {0,0}; boxrect.left = PROMPT_TEXT_SPACE_X_OFFSETFROMLEFT; boxrect.top = PROMPT_TEXT_SPACE_Y_OFFSETFROMTOP; boxrect.right = PROMPT_TEXT_SPACE_X_OFFSETFROMLEFT+PROMPT_TEXT_WIDTH; boxrect.bottom = PROMPT_TEXT_SPACE_Y_OFFSETFROMTOP + PROMPT_TEXT_HEIGHT; LoopSong(globals.musiclist.songs[CREDITS_SONG]); styles[MAX_DUTIES - 1] = CREDIT_REDFLASH; //THE LAST CREDIT MUST ALWAYS BE REDFLASH. GREEN; printgraphic(globals.graphicslist, zeroed, PROMPT_GRAPHIC_ID); for (creditcounter = 0; creditcounter < MAX_DUTIES; creditcounter++){ if (styles[creditcounter] == CREDIT_REDFLASH) { ClearRect(boxrect); dutydrawcoords = retrieveTextCenter(duties[creditcounter]); dutydrawcoords.Y --; namedrawcoords = retrieveTextCenter(names[creditcounter]); RED; setcursor(dutydrawcoords.X, dutydrawcoords.Y); bufferprint(1, duties[creditcounter]); setcursor(dutydrawcoords.X, dutydrawcoords.Y); LRED; bufferprint(1, duties[creditcounter]); Sleep(200); RED; setcursor(namedrawcoords.X, namedrawcoords.Y); bufferprint(1, names[creditcounter]); setcursor(namedrawcoords.X, namedrawcoords.Y); LRED; bufferprint(1, names[creditcounter]); if (creditcounter < MAX_DUTIES - 1) { Sleep(3500); RED; setcursor(dutydrawcoords.X, dutydrawcoords.Y); printf(duties[creditcounter]); setcursor(dutydrawcoords.X, dutydrawcoords.Y); RED; setcursor(namedrawcoords.X, namedrawcoords.Y); printf(names[creditcounter]); setcursor(namedrawcoords.X, namedrawcoords.Y); Sleep(80); setcursor(namedrawcoords.X, namedrawcoords.Y); cleartext(names[creditcounter]); setcursor(dutydrawcoords.X, dutydrawcoords.Y); cleartext(duties[creditcounter]); Sleep(1000); } else{ FLUSH; clearinputrecords(); waitforkey(); StopSong(); cls(); return; } } else if (styles[creditcounter] == CREDIT_GREENFADE) { ClearRect(boxrect); GREEN; printwordwrapcoordinate(duties[creditcounter], boxsize, boxstart); Sleep(80); LGREEN; printwordwrapcoordinate(duties[creditcounter], boxsize, boxstart); Sleep(10000); GREEN; printwordwrapcoordinate(duties[creditcounter], boxsize, boxstart); Sleep(80); ClearRect(boxrect); Sleep(1000); } } }
void CompositorD3D11::BeginFrame(const nsIntRegion& aInvalidRegion, const Rect* aClipRectIn, const Rect& aRenderBounds, Rect* aClipRectOut, Rect* aRenderBoundsOut) { // Don't composite if we are minimised. Other than for the sake of efficency, // this is important because resizing our buffers when mimised will fail and // cause a crash when we're restored. NS_ASSERTION(mHwnd, "Couldn't find an HWND when initialising?"); if (::IsIconic(mHwnd) || gfxPlatform::GetPlatform()->DidRenderingDeviceReset()) { *aRenderBoundsOut = Rect(); return; } nsIntSize oldSize = mSize; UpdateRenderTarget(); // Failed to create a render target or the view. if (!mDefaultRT || !mDefaultRT->mRTView || mSize.width == 0 || mSize.height == 0) { *aRenderBoundsOut = Rect(); return; } mContext->IASetInputLayout(mAttachments->mInputLayout); ID3D11Buffer* buffer = mAttachments->mVertexBuffer; UINT size = sizeof(Vertex); UINT offset = 0; mContext->IASetVertexBuffers(0, 1, &buffer, &size, &offset); nsIntRect intRect = nsIntRect(nsIntPoint(0, 0), mSize); // Sometimes the invalid region is larger than we want to draw. nsIntRegion invalidRegionSafe; if (mSize != oldSize) { invalidRegionSafe = intRect; } else { invalidRegionSafe.And(aInvalidRegion, intRect); } nsIntRect invalidRect = invalidRegionSafe.GetBounds(); mInvalidRect = IntRect(invalidRect.x, invalidRect.y, invalidRect.width, invalidRect.height); mInvalidRegion = invalidRegionSafe; if (aClipRectOut) { *aClipRectOut = Rect(0, 0, mSize.width, mSize.height); } if (aRenderBoundsOut) { *aRenderBoundsOut = Rect(0, 0, mSize.width, mSize.height); } if (aClipRectIn) { invalidRect.IntersectRect(invalidRect, nsIntRect(aClipRectIn->x, aClipRectIn->y, aClipRectIn->width, aClipRectIn->height)); } mCurrentClip = IntRect(invalidRect.x, invalidRect.y, invalidRect.width, invalidRect.height); mContext->RSSetState(mAttachments->mRasterizerState); SetRenderTarget(mDefaultRT); // ClearRect will set the correct blend state for us. ClearRect(Rect(invalidRect.x, invalidRect.y, invalidRect.width, invalidRect.height)); if (mAttachments->mSyncTexture) { RefPtr<IDXGIKeyedMutex> mutex; mAttachments->mSyncTexture->QueryInterface((IDXGIKeyedMutex**)byRef(mutex)); MOZ_ASSERT(mutex); HRESULT hr = mutex->AcquireSync(0, 10000); if (hr == WAIT_TIMEOUT) { MOZ_CRASH(); } mutex->ReleaseSync(0); } }