Esempio n. 1
0
void GuiLabel::Render(const TMatrix4x4f& pViewMatrix)
{
	SetViewMatrix(pViewMatrix*GetAdjMatrix());
	DrawImage(tImgFone, GetVertexObj(), GetStdTextureObj(), cColor);
		
	sCaption.Render(*this,pViewMatrix);

	GuiEnControl::Render(pViewMatrix);
}
Esempio n. 2
0
		void AsyncRenderer::DrawImage(client::IImage *image, const spades::AABB2 &outRect) {
			SPADES_MARK_FUNCTION();
			
			DrawImage(image,
					  outRect,
					  AABB2(0, 0,
							image->GetWidth(),
							image->GetHeight()));
		}
Esempio n. 3
0
void CSkinUnitODL::DrawImage(Gdiplus::Graphics& gcDrawer, Gdiplus::RectF rtDrawArea, Gdiplus::REAL fScale)
{
	if (m_imgSkin)
	{
		Gdiplus::GraphicsPath gcPath;
		gcPath.AddRectangle(rtDrawArea);
		DrawImage(gcDrawer, gcPath, Gdiplus::PointF(rtDrawArea.X,rtDrawArea.Y), fScale);
	}
}
Esempio n. 4
0
void Costix::Draw()
{
	DrawImage();
	FilterBlocks();

	WriteResultBitmap();

	//exit(-1);
}
Esempio n. 5
0
//Splash screen
void Splash() {
	ResetTimer(); //we're going to use it for random seed
	//Setup a world with a tank and a pyramid in specific places
	CloseGraphics();
	OpenGraphics();

	Point3d centre;
	world=CreateNewWorld();

	//A tank pointing straight at us
	centre=CreatePoint(0.0,0.0,45.0);
	obj=CreateTank(GREEN, centre, 4.5);
	RotateObjectYAxis(&obj, 2.0 * PI / 360.0 * 195);
	AddObjectToWorld(&world, obj);

	//A yellow pyramid behind the tank and to the right
	centre=CreatePoint(10.0, 0.0, 70.0);
	obj=CreatePyramid(YELLOW, centre, 5.0);
	RotateObjectYAxis(&obj, 3.0*PI/5.0);
	AddObjectToWorld(&world, obj);

	//A blue cube behind the tank and to the left
	centre=CreatePoint(-10.0, 0.0, 60.0);
	obj=CreateCube(BLUE, centre, 5.0);
	RotateObjectYAxis(&obj, 195.0*PI/180.0);
	AddObjectToWorld(&world,obj);

	//Draw world, add splash graphics, prompt to start
	cameraPos=CreatePoint(0.0,5.0,0.0);
	cameraAngle=CreatePoint(0.0,0.0,0.0);
	DrawWorld(&world, cameraPos, cameraAngle);
	SetTextColor(GREEN);
	DrawText(5,25, "by RorschachUK");

	SetTextColor(CYAN);
	DrawText(5,100, "Help");
	DrawText(110,100,"Start");
	DrawImage(logoImage, 5,5,RGBColor(253,255,252,0));
	DrawImage(signatureImage, 135,24,BLACK);

	Show();
	Sleep(100);
	mode=0;
}
Esempio n. 6
0
EXPORT_C void CHuiCanvasGc::DrawImage(const CHuiTexture& aImage, const THuiRealRect& aDestinationRect)
    {
    if (!iGc)
        {
        return;    
        }

    THuiRealRect srcRect = THuiRealRect(TPoint(0,0), aImage.Size() );
    DrawImage(aImage, aDestinationRect, srcRect);
    }
Esempio n. 7
0
void MythPainter::DrawEllipse(const QRect &area, const QBrush &fillBrush,
                              const QPen &linePen, int alpha)
{
    MythImage *im = GetImageFromRect(area, 0, 1, fillBrush, linePen);
    if (im)
    {
        DrawImage(area.x(), area.y(), im, alpha);
        im->DecrRef();
    }
}
Esempio n. 8
0
		Image* WindowSDL::CreateImage(const void* memory, Int size) const
		{
			auto src = new ImageSDL(memory, size, _renderer);
			auto img = new ImageSDL(src->Width(), src->Height(), _renderer); //Create with SDL_TEXTUREACCESS_TARGET to make it writable

			img->DrawImage({}, src);
			delete src;

			return img;
		}
Esempio n. 9
0
	void CEditUI::PaintStatusImage(HDC hDC)
	{
		if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED;
		else m_uButtonState &= ~ UISTATE_FOCUSED;
		if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED;
		else m_uButtonState &= ~ UISTATE_DISABLED;

		if( (m_uButtonState & UISTATE_DISABLED) != 0 ) {
			if( DrawImage(hDC, m_diDisabled) ) return;
		}
		else if( (m_uButtonState & UISTATE_FOCUSED) != 0 ) {
			if( DrawImage(hDC, m_diFocused) ) return;
		}
		else if( (m_uButtonState & UISTATE_HOT) != 0 ) {
			if( DrawImage(hDC, m_diHot) ) return;
		}

		if( DrawImage(hDC, m_diNormal) ) return;
	}
void MythQImagePainter::DrawRoundRect(const QRect &area, int radius, 
                                      bool drawFill, const QColor &fillColor, 
                                      bool drawLine, int lineWidth,
                                      const QColor &lineColor)
{
    MythImage *im = GetImageFromRect(area.size(), radius, drawFill, fillColor,
                                     drawLine, lineWidth, lineColor);
    if (im)
        DrawImage(area, im, QRect(0, 0, area.width(), area.height()), 255);
}
Esempio n. 11
0
void C2DRenderUtils::RenderTest_Textures( float fTime, const ColorF& color )
{
    int textureID = m_white_texture->GetTextureID();

    float sx = 50.0f;
    float sy = 50.0f;

    ColorF renderCol = color;
    renderCol.r = CLAMP(renderCol.r, renderCol.r, renderCol.r+0.5f);
    renderCol.a *= 0.5f;
    DrawQuad(                                 0.f,   0.f, sx, sy, renderCol );
    DrawImage( textureID,                     0.f,   0.f, sx, sy, 0.0f, color, 0.0f, 1.0f, 1.0f, 0.0f );
    DrawQuad(             m_pLayoutManager->GetVirtualWidth()-sx,   0.f, sx, sy, renderCol );
    DrawImage( textureID, m_pLayoutManager->GetVirtualWidth()-sx,   0.f, sx, sy, 0.0f, color );
    DrawQuad(             m_pLayoutManager->GetVirtualWidth()-sx, m_pLayoutManager->GetVirtualHeight()-sy, sx, sy, renderCol );
    DrawImage( textureID, m_pLayoutManager->GetVirtualWidth()-sx, m_pLayoutManager->GetVirtualHeight()-sy, sx, sy, 0.0f, color );
    DrawQuad(                                 0.f, m_pLayoutManager->GetVirtualHeight()-sy, sx, sy, renderCol );
    DrawImage( textureID,                     0.f, m_pLayoutManager->GetVirtualHeight()-sy, sx, sy, 0.0f, color );
}
Esempio n. 12
0
bool cReelLogoCache::DrawEventImage(const cEvent *Event, int x, int y, int w, int h, int c, cBitmap *bmp)
{
  if (Event == NULL || bmp == NULL)
    return false;

  std::stringstream strFilename;
  strFilename << ReelConfig.GetImagesDir() << '/' << Event->EventID() << '.' << ReelConfig.GetImageExtension();
  int rc = DrawImage(strFilename.str().c_str(), x, y, w, h, c, bmp);
  return rc;
}
Esempio n. 13
0
bool cReelLogoCache::DrawRecordingImage(const cRecording *Recording, int x, int y, int w, int h, int c, cBitmap *bmp)
{
  if (Recording == NULL || bmp == NULL)
    return false;

  std::stringstream strFilename;
  strFilename << Recording->FileName() << '/' << RECORDING_COVER << '.' << ReelConfig.GetImageExtension();
  int rc = DrawImage(strFilename.str().c_str(), x, y, w, h, c, bmp);
  return rc;
}
Esempio n. 14
0
	void CCheckBoxUI::PaintStatusImage(HDC hDC)
	{
		//m_uButtonState &= ~UISTATE_PUSHED;

		if (IsSelected())
		{
			if((m_uButtonState & UISTATE_PUSHED) != 0 && m_sSelectedPushedImage) 
			{
				if (!DrawImage(hDC, *m_sSelectedPushedImage.get())) m_sSelectedPushedImage.reset();
				else goto Label_ForeImage;
			}
			else if ((m_uButtonState & UISTATE_HOT) != 0 && m_sSelectedHotImage) 
			{
				if (!DrawImage(hDC, *m_sSelectedHotImage.get())) m_sSelectedHotImage.reset();
				else goto Label_ForeImage;
			}
			else if (!IsEnabled() && m_sSelectedDisabledImage)
			{
				if (!DrawImage(hDC, *m_sSelectedDisabledImage.get())) m_sSelectedDisabledImage.reset();
				else goto Label_ForeImage;
			}
			else 
			{
				if (m_sSelectedImage) {
					if (!DrawImage(hDC, *m_sSelectedImage.get())) m_sSelectedImage.reset();
					else goto Label_ForeImage;
				}
				else if (m_dwSelectedBkColor != 0) {
					CRenderEngine::DrawColor(hDC, m_rcPaint, m_dwSelectedBkColor);
					return;
				}	
			}
		}

		CButtonUI::PaintStatusImage(hDC);

Label_ForeImage:
		if (m_sForeImage) 
		{
			if (!DrawImage(hDC, *m_sForeImage.get())) m_sForeImage.reset();
		}
	}
Esempio n. 15
0
	void CComboBoxUI::PaintStatusImage(HDC hDC)
	{
		if (m_sArrowImage.IsEmpty())
			CComboUI::PaintStatusImage(hDC);
		else
		{
			// get index
			if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED;
			else m_uButtonState &= ~ UISTATE_FOCUSED;
			if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED;
			else m_uButtonState &= ~ UISTATE_DISABLED;

			int nIndex = 0;
			if ((m_uButtonState & UISTATE_DISABLED) != 0)
				nIndex = 4;
			else if ((m_uButtonState & UISTATE_PUSHED) != 0)
				nIndex = 2;
			else if ((m_uButtonState & UISTATE_HOT) != 0)
				nIndex = 1;
			else if ((m_uButtonState & UISTATE_FOCUSED) != 0)
				nIndex = 3;

			CDuiRect rcBmpPart(m_sArrowImage.GetSource());

			m_nArrowWidth = rcBmpPart.GetWidth() / 5;
			rcBmpPart.left += nIndex * m_nArrowWidth;
			rcBmpPart.right = rcBmpPart.left + m_nArrowWidth;

			CDuiRect rcDest(0, 0, m_rcItem.right - m_rcItem.left, m_rcItem.bottom - m_rcItem.top);
			rcDest.Deflate(GetBorderSize(), GetBorderSize());
			rcDest.left = rcDest.right - m_nArrowWidth;

			// draw image
			if (!DrawImage(hDC, m_sArrowImage))
				m_sNormalImage.Empty();
			else 
			{
				DrawImage(hDC, m_sArrowImage,rcBmpPart);
				DrawImage(hDC, m_sArrowImage,rcDest);
			}
		}
	}
Esempio n. 16
0
		void AsyncRenderer::DrawImage(client::IImage *image,
								   const spades::Vector2 &outTopLeft,
								   const spades::AABB2 &inRect) {
			SPADES_MARK_FUNCTION();
			
			DrawImage(image,
					  AABB2(outTopLeft.x, outTopLeft.y,
							inRect.GetWidth(),
							inRect.GetHeight()),
					  inRect);
		}
void UI_ResetCursorPos(void)
{
  TFT_Set_Pen(MainScreen.Color, 0);
  TFT_Set_Brush(1, MainScreen.Color, 0, LEFT_TO_RIGHT, CL_WHITE, CL_WHITE);
  TFT_Rectangle(Image3.Left, Image3.Top, (Image3.Left+Image3.Width), (Image3.Top+Image3.Height));
  Image3.Left = 10;
  Image3.Top = 28;
  DrawImage(&Image3);
  cursorPos = 0;
  filesListOffset = 0;
}
Esempio n. 18
0
	void CImageAnimationUI::PaintBkImage(HDC hDC)
	{
		if( m_sBkImage.IsEmpty() ) return;
		if(!m_bBkimageMovable)
		{
			if( !DrawImage(hDC, (LPCTSTR)m_sBkImage) ) m_sBkImage.Empty();
		}
		else
		{
			CStdString newBkImage, tempStr;
			int l,r,t,b;
			l = m_iCurrentImage * m_iBkimageMove - m_iLeftOffset*m_iBkimageMove/(m_rectImage.right - m_rectImage.left);
			r = l + m_rectImage.right - m_rectImage.left;
			t = 0;
			b = m_rectImage.bottom - m_rectImage.top;
			newBkImage.Format(_T(" source='%d,%d,%d,%d'"), l, t, r, b);
			tempStr = m_sBkImage + newBkImage;
			if( !DrawImage(hDC, (LPCTSTR)tempStr) ) m_sBkImage.Empty();
		}
	}
Esempio n. 19
0
void DrawScene()
{
	BeginScene(1);
	ImageToScreen(p_bg,0,0);
	DrawImage(p_logo,0,0,0,0,128,0,256,256);
	DrawImageMask(p_logo,0,0,0,0,0/*dx*/,0/*dy*/,128/*dw*/,128/*dh*/,logomask1);
	DrawImageMask(p_logo,0,0,0,0,480-128/*dx*/,272-128/*dy*/,128/*dw*/,128/*dh*/,0x7fffffff);
	DrawImageMask(p_logo,0,0,0,0,0/*dx*/,272-128/*dy*/,128/*dw*/,128/*dh*/,logomask2);
	DrawImageMask(p_logo,0,0,0,0,480-128/*dx*/,0/*dy*/,128/*dw*/,128/*dh*/,logomask2);
	EndScene();
}
Esempio n. 20
0
u8 DeleteSelectJob(const TSA_JOB_MGR_MENU SelJob)
{
    u16 SelectionIndex = (u16)(SelJob - JM_SEL1);
    u16 SelJobIndex = (PAGE_JOB_COUNT * (gJobPageNo - 1) + SelectionIndex) + 1;

    // 삭제 가능한지 체크
    if(SelJobIndex < 1 || SelJobIndex > gxFileCount)
        return FALSE;

    // 재배치
    JOB_INFO srcInfo;
    STEP_MANAGER stepMgr;

    // 초기화
    InitStepMgr(&stepMgr);
    for(u16 nCount=SelJobIndex+1; nCount<=gxFileCount; nCount++)
    {
        ReadJobData(&srcInfo, &stepMgr, nCount);
        srcInfo.JobNo--;
        SaveJobData(srcInfo, &stepMgr, srcInfo.JobNo - 1);
    }

    // last file remove
    FRESULT fr = FR_OK;
    char strTemp[64] = {0, };
    sprintf(strTemp, "%.64s/pJOB%.3d.job", DIR_JOB, gxFileCount);
    fr = f_unlink(strTemp);
    if(fr != FR_OK)
        return FALSE;

    // Page no calcuration
    gEditableJob = DISABLE;
    gPreJobMgrMenu = JM_NONE;
    if( gJobPageNo > 1 && SelectionIndex == 0 )
    {
        gJobPageNo--;
        gJobMgrMenu = JM_SEL12;
    }
    else if( (--gxFileCount) > 0)
        gJobMgrMenu = (TSA_JOB_MGR_MENU)(SelJob != JM_SEL1 ? (SelJob - 1) : JM_SEL1);
    else
        gJobMgrMenu = JM_NONE;

    if(gJobMgrMenu >= JM_SEL1 && gJobMgrMenu <= JM_SEL12)	gIsJobNotPlaySound = TRUE;

    // 리스트 초기화
    DrawImage(PT_SEL_START_X, PT_SEL_START_Y, NM_BG_JOB_LIST);

    RefreashJobList(gJobPageNo);

    DisplayJobList();

    return TRUE;
}
Esempio n. 21
0
		void AsyncRenderer::DrawImage(client::IImage *image,
								   const spades::AABB2 &outRect,
								   const spades::AABB2 &inRect) {
			SPADES_MARK_FUNCTION();
			
			DrawImage(image,
					  Vector2::Make(outRect.GetMinX(), outRect.GetMinY()),
					  Vector2::Make(outRect.GetMaxX(), outRect.GetMinY()),
					  Vector2::Make(outRect.GetMinX(), outRect.GetMaxY()),
					  inRect);
		}
Esempio n. 22
0
	void COptionUI::PaintForeImage(HDC hDC)
	{
		if(IsSelected()) {
			if( !m_sSelectedForeImage.IsEmpty() ) {
				if( !DrawImage(hDC, (LPCTSTR)m_sSelectedForeImage) ) {}
				else return;
			}
		}

		return CButtonUI::PaintForeImage(hDC);
	}
Esempio n. 23
0
void MythPainter::DrawRoundRect(const QRect &area, int cornerRadius,
                                const QBrush &fillBrush, const QPen &linePen,
                                int alpha)
{
    MythImage *im = GetImageFromRect(area, cornerRadius, 0, fillBrush, linePen);
    if (im)
    {
        DrawImage(area.x(), area.y(), im, alpha);
        im->DecrRef();
    }
}
// ImageViewDialog message handlers
void ImageViewDialog::OnPaint() {
  BufferredPaintDC dc(this);
  
  CRect rectTitle;
  GetDlgItem(IDC_PLACE_CAPTION)->GetWindowRect(&rectTitle);
  ScreenToClient(&rectTitle);
  dc.FillSolidRect(rectTitle, RGB(54, 133, 214));

  CRect imageRect;
  GetDlgItem(IDC_PLACE_IMAGE)->GetWindowRect(&imageRect);
  ScreenToClient(&imageRect);
  dc.FillSolidRect(imageRect, RGB(0, 0, 0));

  CRect topRect(imageRect.left, imageRect.top, 
      imageRect.right, imageRect.top + imageRect.Height() / 2);
  CRect bottomRect(imageRect.left, topRect.bottom, imageRect.right, imageRect.bottom);
  dc.SetStretchBltMode(HALFTONE);
  DrawImage(&dc, &topImage_, topRect);
  DrawImage(&dc, &bottomImage_, bottomRect);
}
Esempio n. 25
0
void MythPainter::DrawImage(int x, int y, MythImage *im, int alpha)
{
    if (!im)
    {
        VERBOSE(VB_IMPORTANT,
                    "Null image pointer passed to MythPainter::DrawImage()");
        return;
    }
    QRect dest = QRect(x, y, im->width(), im->height());
    QRect src = im->rect();
    DrawImage(dest, im, src, alpha);
}
Esempio n. 26
0
	void CSliderUI::PaintStatusImage(HDC hDC)
	{
		CProgressUI::PaintStatusImage(hDC);

		RECT rcThumb = GetThumbRect();
		rcThumb.left -= m_rcItem.left;
		rcThumb.top -= m_rcItem.top;
		rcThumb.right -= m_rcItem.left;
		rcThumb.bottom -= m_rcItem.top;
		if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) {
			m_diThumbPushed.rcDestOffset = rcThumb;
			if( DrawImage(hDC, m_diThumbPushed) ) return;
		}
		else if( (m_uButtonState & UISTATE_HOT) != 0 ) {
			m_diThumbHot.rcDestOffset = rcThumb;
			if( DrawImage(hDC, m_diThumbHot) ) return;
		}

		m_diThumb.rcDestOffset = rcThumb;
		if( DrawImage(hDC, m_diThumb) ) return;
	}
Esempio n. 27
0
void MythPainter::DrawImage(int x, int y, MythImage *im, int alpha)
{
    if (!im)
    {
        LOG(VB_GENERAL, LOG_ERR,
                    "Null image pointer passed to MythPainter::DrawImage()");
        return;
    }
    QRect dest = QRect(x, y, im->width(), im->height());
    QRect src = im->rect();
    DrawImage(dest, im, src, alpha);
}
Esempio n. 28
0
	void COptionUI::PaintStatusImage(HDC hDC)
	{
		do 
		{
			if ((m_uButtonState & UISTATE_PUSHED) != 0 && IsSelected() && m_selectedPushedImage.IsLoadSuccess())
			{
			if (DrawImage(hDC, m_selectedPushedImage))
				break;
			}
			else if ((m_uButtonState & UISTATE_HOT) != 0 && IsSelected() && m_selectedHotImage.IsLoadSuccess()) {
				if (DrawImage(hDC, m_selectedHotImage))
					break;
			}
			else if ((m_uButtonState & UISTATE_SELECTED) != 0)
			{
				if (m_selectedImage.IsLoadSuccess())
				{
					if (DrawImage(hDC, m_selectedImage))
						break;
				}
				else if (m_dwSelectedBkColor != 0)
				{
					CRenderEngine::DrawColor(hDC, m_rcPaint, GetAdjustColor(m_dwSelectedBkColor));
					return;
				}
			}

			CButtonUI::PaintStatusImage(hDC);
		} while (0);

		if ( IsSelected() && m_selectedForeImage.IsLoadSuccess())
		{
			DrawImage(hDC, m_selectedForeImage);
		}
		else if( m_foreImage.IsLoadSuccess() ) 
		{
			DrawImage(hDC, m_foreImage);
		}

	}
Esempio n. 29
0
void C2DRenderUtils::DrawImageCentered(int iTextureID,	float fX,
                                       float fY,
                                       float fSizeX,
                                       float fSizeY,
                                       float fAngleInDegrees,
                                       const ColorF& cfColor,
                                       bool pushToList /* = false*/)
{
    float fImageX = fX - 0.5f * fSizeX;
    float fImageY = fY - 0.5f * fSizeY;

    DrawImage(iTextureID,fImageX,fImageY,fSizeX,fSizeY,fAngleInDegrees,cfColor, 0.0f, 0.0f, 1.0f, 1.0f, UIDRAWHORIZONTAL_LEFT, UIDRAWVERTICAL_TOP, UIDRAWHORIZONTAL_LEFT, UIDRAWVERTICAL_TOP, pushToList);
}
Esempio n. 30
0
	void CScrollBarUI::PaintButton2(HDC hDC)
	{
		if( !m_bShowButton2 ) return;

		if( !IsEnabled() ) m_uButton2State |= UISTATE_DISABLED;
		else m_uButton2State &= ~ UISTATE_DISABLED;

		m_sImageModify.Empty();
		m_sImageModify.SmallFormat(_T("dest='%d,%d,%d,%d'"), m_rcButton2.left - m_rcItem.left, \
			m_rcButton2.top - m_rcItem.top, m_rcButton2.right - m_rcItem.left, m_rcButton2.bottom - m_rcItem.top);

		if( (m_uButton2State & UISTATE_DISABLED) != 0 ) {
			if( !m_sButton2DisabledImage.IsEmpty() ) {
				if( !DrawImage(hDC, (LPCTSTR)m_sButton2DisabledImage, (LPCTSTR)m_sImageModify) ) {}
				else return;
			}
		}
		else if( (m_uButton2State & UISTATE_PUSHED) != 0 ) {
			if( !m_sButton2PushedImage.IsEmpty() ) {
				if( !DrawImage(hDC, (LPCTSTR)m_sButton2PushedImage, (LPCTSTR)m_sImageModify) ) {}
				else return;
			}
		}
		else if( (m_uButton2State & UISTATE_HOT) != 0 ) {
			if( !m_sButton2HotImage.IsEmpty() ) {
				if( !DrawImage(hDC, (LPCTSTR)m_sButton2HotImage, (LPCTSTR)m_sImageModify) ) {}
				else return;
			}
		}

		if( !m_sButton2NormalImage.IsEmpty() ) {
			if( !DrawImage(hDC, (LPCTSTR)m_sButton2NormalImage, (LPCTSTR)m_sImageModify) ) {}
			else return;
		}

		DWORD dwBorderColor = 0xFF85E4FF;
		int nBorderSize = 2;
		CRenderEngine::DrawRect(hDC, m_rcButton2, nBorderSize, dwBorderColor);
	}