paint.c

Go to the documentation of this file.
00001 /* --
00002 OpenFX version 1.0 - Modelling, Animation and Rendering Package
00003 Copyright (C) 2000 OpenFX Development Team
00004 
00005 This program is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU General Public License
00007 as published by the Free Software Foundation; either version 2
00008 of the License, or (at your option) any later version.
00009 
00010 This program is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 GNU General Public License for more details.
00014 
00015 You should have received a copy of the GNU General Public License
00016 along with this program; if not, write to the Free Software
00017 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018 
00019 You may contact the OpenFX development team via elecronic mail
00020 at core@openfx.org, or visit our website at http://openfx.org for
00021 further information and support details.
00022 -- */
00023 
00024 /* PAINT.C */
00025 
00026 static void PaintBackground(HWND hDlg){
00027  int x;
00028  int y;
00029  HDC hDC;
00030  HPALETTE hpalT;
00031  HBRUSH hOldBrush;
00032  RECT rc1,rc2;
00033  HDC hMemDC;
00034  HBITMAP hBmBackground,hbmOld;
00035  BITMAP  bm;
00036  PAINTSTRUCT ps;
00037  hDC = BeginPaint(hDlg,&ps);
00038  hBmBackground=LoadBitmap(hDLLinstance,"screen");
00039  if(hBmBackground != NULL){
00040    GetObject(hBmBackground,sizeof(BITMAP),&bm);
00041    hMemDC = CreateCompatibleDC(hDC);
00042    hbmOld = SelectObject(hMemDC,hBmBackground);
00043    GetClientRect(hDlg,&rc2);
00044    for(x=0;x<(rc2.right/bm.bmWidth)+1;x++)
00045    for(y=0;y<(rc2.bottom/bm.bmHeight)+1;y++)
00046      BitBlt(hDC,
00047           x*bm.bmWidth,y*bm.bmHeight,
00048           bm.bmWidth,
00049           bm.bmHeight,
00050           hMemDC,
00051           0,0,
00052           SRCCOPY);
00053    SelectObject(hMemDC,hbmOld);
00054    DeleteDC(hMemDC);
00055    DeleteObject(hBmBackground);
00056  }
00057  EndPaint(hDlg,&ps);
00058 }
00059 
00060 static void CentreDialogOnScreen(HWND hwnd){
00061  RECT rcDlg;
00062  long Xres,Yres;
00063  Yres=GetSystemMetrics(SM_CYSCREEN);
00064  Xres=GetSystemMetrics(SM_CXSCREEN);
00065  GetWindowRect(hwnd,&rcDlg);
00066  OffsetRect(&rcDlg,-rcDlg.left,-rcDlg.top);
00067  OffsetRect(&rcDlg,(Xres-rcDlg.right)/2,(Yres-rcDlg.bottom)/2);
00068  SetWindowPos(hwnd,HWND_TOP,rcDlg.left,rcDlg.top,0,0,SWP_NOSIZE);
00069  return;
00070 }
00071 
00072 static void LoadAnimatedClip(HWND hDlg){
00073  char *c,modname[256];
00074  GetModuleFileName(hDLLinstance,modname,255);
00075  if((c=strrchr(modname,'.')) != NULL){
00076    strcpy(c,".avi");
00077    Animate_Open(GetDlgItem(hDlg,DLG_ANIMATE),modname);
00078    Animate_Play(GetDlgItem(hDlg,DLG_ANIMATE),0, -1, -1);
00079  }
00080 }
Generated on Tue Jan 28 06:18:30 2014 for OpenFX by  doxygen 1.6.3