国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
自己寫的頻譜控件比較簡單,初始版
/*******************************************************************************
    文件名稱 : MusicLine.h 頭文件
    作    者 : 楊治忠
    創(chuàng)建時(shí)間 : 2011-1-3  9:04:27
    文件描述 : 音樂頻譜顯示控件
    版權(quán)聲明 : QQ號940446982
    修改歷史 : 楊治忠  2011-1-3    1.00    初始版本
*******************************************************************************/
#pragma once
// CMusicLine
class CMusicLine : public CWnd
{
 DECLARE_DYNAMIC(CMusicLine)
 //外部接口函數(shù):
public:
 void SetRunTime(int Time);//設(shè)置定時(shí)器
 void SetBackColor(int penR,int penG,int penB,int brushR,int brushG,int brushB);//設(shè)置背景色
 void SetColor(int penR,int penG,int penB,int brushR,int brushG,int brushB);//設(shè)置頻譜色
 void SetOneWidth(int oneW,int oneK);//設(shè)置頻譜寬度和頻譜間的空隙
 void IntPutSum(int sumF[][100],int sumA,int sumB,int T);//傳入數(shù)據(jù)
private:
 void DrawPicture();
 int time;
 int pen_rb, pen_gb, pen_bb, brush_rb, brush_gb, brush_bb;
 int pen_r, pen_g, pen_b, brush_r, brush_g, brush_b;
 int one_w,one_k;
 int sum_f[45][100],sum_a,sum_b,t;
 int l;
public:
 CMusicLine();
 virtual ~CMusicLine();
protected:
 DECLARE_MESSAGE_MAP()
public:
 afx_msg void OnTimer(UINT_PTR nIDEvent);
};

// MusicLine.cpp : 實(shí)現(xiàn)文件
/*******************************************************************************
    文件名稱 : MusicLine.cpp 實(shí)現(xiàn)文件
    作    者 : 楊治忠
    創(chuàng)建時(shí)間 : 2011-1-3  9:08:47
    文件描述 : 音樂頻譜顯示控件
    版權(quán)聲明 : QQ號940446982
    修改歷史 : 楊治忠 2011-1-3    1.00    初始版本
*******************************************************************************/
#include "stdafx.h"
#include "MusicLine.h"

// CMusicLine
IMPLEMENT_DYNAMIC(CMusicLine, CWnd)
CMusicLine::CMusicLine()
{
 pen_rb   = 0; pen_gb   = 0; pen_bb   = 0;
 brush_rb = 0; brush_gb = 0; brush_bb = 0;
 pen_r    = 0; pen_g    = 0; pen_b    = 0;
 brush_r  = 0; brush_g  = 0; brush_b  = 0;
 one_w    = 1; one_k    = 0;
 sum_a    = 0; sum_b    = 0; t        = 0;
 time     = 1000;
 l        = 1;
}
CMusicLine::~CMusicLine()
{
}

BEGIN_MESSAGE_MAP(CMusicLine, CWnd)
 ON_WM_TIMER()
END_MESSAGE_MAP()
// CMusicLine 消息處理程序
void CMusicLine::OnTimer(UINT_PTR nIDEvent)
{
 // TODO: 在此添加消息處理程序代碼和/或調(diào)用默認(rèn)值
     DrawPicture();
 CWnd::OnTimer(nIDEvent);
}
/********************************************************************
函數(shù)名稱  : DrawPicture()
函數(shù)描述  : 畫頻譜
輸入?yún)?shù)  : void
輸出參數(shù)  : void
備注      : QQ號:940446982
*********************************************************************/
 void CMusicLine::DrawPicture()
 {
  CDC *pDC = GetDC();
  CRect rect;
  GetClientRect(&rect);
  //創(chuàng)建位圖:
  CBitmap bitmap;
  CBitmap* oldbitmap;
  CDC Memdc;
  Memdc.CreateCompatibleDC(pDC);
  bitmap.CreateCompatibleBitmap(pDC,rect.Width(),rect.Height());
  oldbitmap = Memdc.SelectObject(&bitmap);
  CPen pen,*oldPen;
  /***************畫控件背景***************************/
  pen.CreatePen(PS_SOLID,1,RGB(pen_rb,pen_gb,pen_bb));
  oldPen   = Memdc.SelectObject(&pen);
  CBrush brush, *oldbrush;
  brush.CreateSolidBrush(RGB(brush_rb,brush_gb,brush_bb));
  oldbrush = Memdc.SelectObject(&brush);
  Memdc.Rectangle(rect.left,rect.top,rect.Width(),rect.Height());
  Memdc.SelectObject(oldPen);
  pen.DeleteObject();
  Memdc.SelectObject(&brush);
  brush.DeleteObject();
     /****************畫頻譜******************************/
  pen.CreatePen(PS_SOLID,1,RGB(pen_r,pen_g,pen_b));
  oldPen   = Memdc.SelectObject(&pen);
  brush.CreateSolidBrush(RGB(brush_r,brush_g,brush_b));
  oldbrush = Memdc.SelectObject(&brush);
 
  int a; a = 1000/time;
  for (int i=0;i<sum_a;i++)
  {
   int b,c;
   b = rect.Height()-(sum_f[t+1][i]-sum_f[t][i])/a*l;
   c = rect.Height()-(sum_f[t+1][i]-sum_f[t][i])+l;
   if (b>rect.Height())
   {
    b = rect.Height();
    if (c>b)
    {
     c = b-1;
    }
   }
   else if (b<rect.top+3)
   {
    b = rect.top+20;
   }
   if (c<rect.top)
   {
    c = rect.top+2;
   }
   Memdc.Rectangle(i*one_w,rect.Height(),i*one_w+one_w-one_k,b);
   Memdc.MoveTo(i*one_w,c);
   Memdc.LineTo(i*one_w+one_w-one_k,c);
  }
  t++;
   if (t==40)
   {
    t=0;
   }
  l++;
  if (a==l)
  {
   l=1;
  }
  Memdc.SelectObject(oldPen);
  pen.DeleteObject();
  Memdc.SelectObject(&brush);
  brush.DeleteObject();
  //顯示位圖:
  pDC->BitBlt(0,0,rect.Width(),rect.Height(),&Memdc,0,0,SRCCOPY);
  Invalidate();
 }

//以下接口函數(shù):
/********************************************************************
函數(shù)名稱  : SetRunTime(int time)
函數(shù)描述  : 開啟定時(shí)器并設(shè)置定時(shí)器的速度
輸入?yún)?shù)  : int Time 微秒為單位
輸出參數(shù)  : void
備注      : QQ號:940446982
*********************************************************************/
void CMusicLine::SetRunTime(int Time)
{
 time = Time;
 SetTimer(0,time,NULL);
}
/***************************************************************************************
函數(shù)名稱  : BackColor(int penR,int penG,int penB,int brushR,int brushG,int brushB)
函數(shù)描述  : 設(shè)置控件背景顏色
輸入?yún)?shù)  : int penR,int penG,int penB,int brushR,int brushG,int brushB 畫筆畫刷三色值
輸出參數(shù)  : int pen_rb, pen_gb, pen_bb, brush_rb, brush_gb, brush_bb;
備注      : QQ號:940446982
****************************************************************************************/
void CMusicLine:: SetBackColor(int penR,int penG,int penB,int brushR,int brushG,int brushB)
{
 pen_rb   = penR;  
 pen_gb   = penG;  
 pen_bb   = penB;
 brush_rb = brushR;
 brush_gb = brushG;
 brush_bb = brushB;
 
}
/**************************************************************************************
函數(shù)名稱  : setColor(int penR,int penG,int penB,int brushR,int brushG,int brushB)
函數(shù)描述  : 設(shè)置頻譜顏色
輸入?yún)?shù)  : int penR,int penG,int penB,int brushR,int brushG,int brushB 畫筆畫刷三色值
輸出參數(shù)  : int pen_r, pen_g, pen_b, brush_r, brush_g, brush_b;
備注      : QQ號:940446982
***************************************************************************************/
void CMusicLine::SetColor(int penR,int penG,int penB,int brushR,int brushG,int brushB)
{
    pen_r   = penR;  
 pen_g   = penG;  
 pen_b   = penB;
 brush_r = brushR;
 brush_g = brushG;
 brush_b = brushB;
}
/********************************************************************
函數(shù)名稱  : OneWidth(int oneW)
函數(shù)描述  : 設(shè)置每個(gè)頻譜的寬度和兩個(gè)頻譜間的空隙
輸入?yún)?shù)  : oneW ,oneK 頻譜的寬度,和頻譜間隙值
輸出參數(shù)  : one_w,one_k
備注      : QQ號:940446982
*********************************************************************/
void CMusicLine:: SetOneWidth(int oneW,int oneK)
{
 one_w = oneW;
 one_k = oneK;
}
/********************************************************************
函數(shù)名稱  : IntPutSum(int *sumF,int sumS,int T)
函數(shù)描述  : 輸入數(shù)組
輸入?yún)?shù)  : int *sumF,int sumA,int sumB數(shù)組地址和數(shù)組個(gè)數(shù)值int T
輸出參數(shù)  : int *sum_f,sum_s;
備注      : QQ號:940446982
*********************************************************************/
void CMusicLine::IntPutSum(int sumF[][100],int sumA,int sumB,int T)
{
 sum_a = sumA;
 sum_b = sumB;
 t     = T;
 for (int i=0;i<sum_b;i++)
    for (int j=0;j<sum_a;j++)
 
 {
  sum_f[i][j]=sumF[i][j];
 }
}
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
進(jìn)度條相關(guān)
GDI 編程小結(jié)
各種筆
用Visual C++從位圖文件生成任意形狀的窗口 [轉(zhuǎn) - dingdang的維客筆記 ...
C# GDI+ 繪圖
關(guān)于SetWindowOrg和SetViewportOrg函數(shù)的說明!
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服