// BitmapSlider.cpp : implementation file
//
#include "stdafx.h"
#include "BitmapSlider.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//
// CBitmapSlider v1.5
//
// It's free for everywhere - 16/September/2003 - Joon-ho Ryu
//
/////////////////////////////////////////////////////////////////////////////
CBitmapSlider::CBitmapSlider()
{
m_nPos = m_nMin = 0;
m_nMax = 100;
m_nPage = 20;
m_nMarginLeft = m_nMarginRight = m_nMarginTop = m_nMarginBottom = 0;
m_nThumbWidth = m_nThumbHeight = 0;
m_bChannel = m_bVertical = m_bThumb = m_bLButtonDown = FALSE;
m_bFocusRect = m_bFocus = FALSE;
m_bDrawFocusRect = TRUE;
m_bEnable = TRUE;
m_nThumbBgX = m_nThumbBgY = -1;
}
CBitmapSlider::~CBitmapSlider()
{
}
BEGIN_MESSAGE_MAP(CBitmapSlider, CStatic)
//{{AFX_MSG_MAP(CBitmapSlider)
ON_WM_ERASEBKGND()
ON_WM_PAINT()
ON_WM_LBUTTONDOWN()
ON_WM_MOUSEMOVE()
ON_WM_LBUTTONUP()
ON_WM_GETDLGCODE()
ON_WM_KEYDOWN()
ON_WM_KILLFOCUS()
ON_WM_SETFOCUS()
ON_WM_CREATE()
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CBitmapSlider message handlers
BOOL CBitmapSlider::OnEraseBkgnd(CDC* pDC)
{
// Do not erase background for the transparency effect
return TRUE;
}
// Draw channel and thumb
//
void CBitmapSlider::OnPaint()
{
CPaintDC dcOrigin(this);
// "Flicker Free Drawing In MFC" by Keith Rule
CMemDC dc( &dcOrigin, &m_rect, m_bTransparentChannel );
CDC dcMem;
dcMem.CreateCompatibleDC( &dc );
CBitmap *pbmTmp;
// Delete focus rectangle for transparent channel
if( m_bFocusRect && ( m_bTransparentChannel || !m_bChannel ) ) {
dc.DrawFocusRect( m_rect );
m_bFocusRect = FALSE;
}
// Draw channel
if( m_bChannel ) {
pbmTmp = dcMem.SelectObject( &m_bmChannel );
// There is a bitmap for active channel
if( m_bChannelActive && m_bEnable ) {
// Vertical slider
if( m_bVertical ) {
// Lower part
DrawBitmap( &dc, 0, Pos2Pixel(m_nPos),
m_nWidth, m_nHeight - Pos2Pixel(m_nPos),
&dcMem, 0, Pos2Pixel(m_nPos),
&m_bmChannelActiveMask, m_bTransparentChannel );
dcMem.SelectObject( &m_bmChannelActive );
// Upper part
DrawBitmap( &dc, 0, 0, m_nWidth, Pos2Pixel(m_nPos),
&dcMem, 0, 0, &m_bmChannelMask, m_bTransparentChannel );
// Horizontal slider
} else {
// Right side
DrawBitmap( &dc, Pos2Pixel(m_nPos), 0,
m_nWidth - Pos2Pixel(m_nPos), m_nHeight,
&dcMem, Pos2Pixel(m_nPos), 0,
&m_bmChannelActiveMask, m_bTransparentChannel );
dcMem.SelectObject( &m_bmChannelActive );
// Left side
DrawBitmap( &dc, 0, 0, Pos2Pixel(m_nPos), m_nHeight,
&dcMem, 0, 0, &m_bmChannelMask, m_bTransparentChannel );
}
// Only one bitmap for channel
} else {
DrawBitmap( &dc, 0, 0, m_nWidth, m_nHeight,
&dcMem, 0, 0, &m_bmChannelMask, m_bTransparentChannel );
}
dcMem.SelectObject( pbmTmp );
}
// If there is a bitmap to restore background image of a thumb
if( m_nThumbBgX != -1 ) {
RestoreBackground(
&dc, m_nThumbBgX, m_nThumbBgY,
m_nThumbWidth, m_nThumbHeight, &m_bmThumbBg );
m_nThumbBgX = -1;
}
// Draw thumb
if( m_bThumb && m_bEnable ) {
if( m_bThumbActive && m_bLButtonDown )
pbmTmp = dcMem.SelectObject( &m_bmThumbActive ); // Active thumb
else
pbmTmp = dcMem.SelectObject( &m_bmThumb ); // Normal thumb
// Vertical slider
if( m_bVertical ) {
// Background image is need to be restored
if( m_bTransparentChannel || !m_bChannel ) {
m_nThumbBgX = m_nMarginLeft;
m_nThumbBgY = Pos2Pixel(m_nPos) - m_nThumbHeight/2;
CopyBackground(
&dc, m_nThumbBgX, m_nThumbBgY,
m_nThumbWidth, m_nThumbHeight, &m_bmThumbBg );
}
DrawBitmap(
&dc, m_nMarginLeft, Pos2Pixel(m_nPos) - m_nThumbHeight/2,
m_nThumbWidth, m_nThumbHeight,
&dcMem, 0, 0, &m_bmThumbMask, m_bTransparentThumb );
// Horizontal slider
} else {
// Background image is need to be restored
if( m_bTransparentChannel || !m_bChannel ) {
m_nThumbBgX = Pos2Pixel(m_nPos) - m_nThumbWidth/2;
m_nThumbBgY = m_nMarginTop;
CopyBackground(
&dc, m_nThumbBgX, m_nThumbBgY,
m_nThumbWidth, m_nThumbHeight, &m_bmThumbBg );
}
DrawBitmap(
&dc, Pos2Pixel(m_nPos) - m_nThumbWidth/2, m_nMarginTop,
m_nThumbWidth, m_nThumbHeight,
&dcMem, 0, 0, &m_bmThumbMask, m_bTransparentThumb );
} // if horizontal
dcMem.SelectObject( pbmTmp );
} // if draw thumb
// Draw focus rectangle
if( m_bDrawFocusRect && m_bFocus && m_bEnable ) {
dc.DrawFocusRect( m_rect );
m_bFocusRect = TRUE;
}
dcMem.DeleteDC();
}
// Sets the maximum range for the slider.
//
// Parameters:
// [IN] nMax
// Maximum position for the slider.
// [IN] bRedraw
// TRUE to redraw after the range is set.
// FALSE to only change maximum position.
//
void CBitmapSlider::SetRangeMax(int nMax, BOOL bRedraw)
{
m_nMax = nMax;
if( bRedraw )
Invalidate();
}
// Sets the minimum range for the slider.
//
// Parameters:
// [IN] nMin
// Minimum position for the slider.
// [IN] bRedraw
// TRUE to redraw after the range is set.
// FALSE to only change minimum position.
//
void CBitmapSlider::SetRangeMin(int nMin, BOOL bRedraw)
{
m_nMin = nMin;
if( bRedraw )
Invalidate();
}
// Sets the range (minimum and maximum positions) for the slider.
//
// Parameters:
// [IN] nMin
// Minimum position for the slider.
// [IN] nMax
// Maximum position for the slider.
// [IN] bRedraw
// TRUE to redraw after the range is set.
// FALSE to only change the range.
//
void CBitmapSlider::SetRange(int nMin, int nMax, BOOL bRedraw)
{
SetRangeMin( nMin, FALSE );
SetRangeMax( nMax, bRedraw );
}
// Sets the current position of the slider.
//
// Parameters:
// [IN] nPos
// Specifies the new slider position.
//
void CBitmapSlider::SetPos(int nPos)
{
m_nPos = nPos;
// Boundary check
if( m_nPos > m_nMax )
m_nPos = m_nMax;
if( m_nPos < m_nMin )
m_nPos = m_nMin;
Invalidate();
}
// Sets the size of the page for a control.
//
// Parameters:
// [IN] nSize
// The new page size of the control.
//
// Return value:
// The previous page size.
//
int CBitmapSlider::SetPageSize(int nSize)
{
int nRet = m_nPage;
m_nPage = nSize;
return nRet;
}
// Sets the left, top, right, and bottom margins for a control
//
void CBitmapSlider::SetMargin(int nLeft, int nTop, int nRight, int nBottom )
{
SetMarginLeft( nLeft );
SetMarginTop( nTop );
SetMarginRight( nRight );
SetMarginBottom( nBottom );
}
// Enables or disables control.
//
// [IN] bEnable
// TRUE to enable control.
// FALSE to disable control.
//
void CBitmapSlider::Enable(BOOL bEnable)
{
m_bEnable = bEnable;
// If control is disabled during dragging
if( !m_bEnable && m_bLButtonDown ) {
m_bLButtonDown = FALSE;
ReleaseCapture();
}
Invalidate();
}
// Specify whether draw focus rectangle or not.
//
// [IN] bDraw
// TRUE to draw focus rectangle.
// FALSE to hide focus rectangle.
//
// [IN] bRedraw
// TRUE to redraw status is changed.
// FALSE to only change the status.
//
void CBitmapSlider::DrawFocusRect(BOOL bDraw, BOOL bRedraw)
{
m_bDrawFocusRect = bDraw;
if( bRedraw )
Invalidate();
}
// Load bitmaps for a channel
//
// Parameters:
// [IN] nChannelID
// ID number of the bitmap resource of the channel.
// [IN] nActiveID
// ID number of the bitmap resource of the active channel.
// [IN] bTransparent
// TRUE to apply transparency effect.
// FALSE to display normal bitm
没有合适的资源?快使用搜索试试~ 我知道了~
基于VS2008+VLC流媒体播放器
共340个文件
dll:285个
h:22个
ico:7个
4星 · 超过85%的资源 需积分: 35 176 下载量 10 浏览量
2013-04-10
09:51:14
上传
评论 6
收藏 27.16MB ZIP 举报
温馨提示
部分代码是我从CodeProject上下载的,经过修改和添加,实现了VLC流媒体播放器的基本功能。同时,添加了新的进度条控件,避免了VS2008中自带进度条拖拽位置不准确的缺点,并且使得界面更加美观。 代码是在VS2008平台下编译和实现的。
资源推荐
资源详情
资源评论
收起资源包目录
基于VS2008+VLC流媒体播放器 (340个子文件)
libvlccore.dll.a 412KB
libvlc.dll.a 162KB
vol_off.bmp 13KB
vol_on.bmp 13KB
mp_channel.bmp 12KB
mp_channel_active.bmp 12KB
mp_thumb.bmp 848B
mp_thumb_active.bmp 848B
BitmapSlider.cpp 22KB
VlcDialogDlg.cpp 13KB
VLCWrapperImpl.cpp 3KB
VLCWrapper.cpp 2KB
VlcDialog.cpp 1KB
StdAfx.cpp 27B
plugins.dat 326KB
libqt4_plugin.dll 11.05MB
libavcodec_plugin.dll 9.09MB
libskins2_plugin.dll 2.18MB
libvlccore.dll 2.18MB
libgnutls_plugin.dll 1.93MB
libvorbis_plugin.dll 1.64MB
libsamplerate_plugin.dll 1.45MB
libprojectm_plugin.dll 1.4MB
libzvbi_plugin.dll 1.33MB
libtaglib_plugin.dll 1.24MB
libschroedinger_plugin.dll 1.2MB
libxml_plugin.dll 1.18MB
libmkv_plugin.dll 1.16MB
libx264_plugin.dll 1.15MB
libsid_plugin.dll 951KB
liblibass_plugin.dll 914KB
libcaca_plugin.dll 751KB
libstream_filter_dash_plugin.dll 708KB
libfreetype_plugin.dll 680KB
liblive555_plugin.dll 656KB
libmod_plugin.dll 474KB
libstream_out_rtp_plugin.dll 468KB
libstream_filter_httplive_plugin.dll 436KB
librtp_plugin.dll 413KB
libstream_out_raop_plugin.dll 411KB
libremoteosd_plugin.dll 409KB
libaccess_output_shout_plugin.dll 405KB
libgme_plugin.dll 401KB
libtheora_plugin.dll 378KB
libfaad_plugin.dll 363KB
libswscale_plugin.dll 362KB
liblua_plugin.dll 302KB
libupnp_plugin.dll 279KB
libflac_plugin.dll 259KB
libfluidsynth_plugin.dll 257KB
libdvdnav_plugin.dll 253KB
libgoom_plugin.dll 229KB
liblibbluray_plugin.dll 228KB
libdshow_plugin.dll 215KB
libmp4_plugin.dll 192KB
libblend_plugin.dll 190KB
libdeinterlace_plugin.dll 184KB
libpng_plugin.dll 181KB
libdtstofloat32_plugin.dll 178KB
libatmo_plugin.dll 177KB
libdvdread_plugin.dll 175KB
liblibmpeg2_plugin.dll 163KB
libdtv_plugin.dll 160KB
libspeex_plugin.dll 151KB
libtwolame_plugin.dll 151KB
libdvbsub_plugin.dll 151KB
libi420_rgb_sse2_plugin.dll 136KB
libmpgatofixed32_plugin.dll 132KB
libts_plugin.dll 132KB
libcdda_plugin.dll 128KB
libvlc.dll 109KB
libspatializer_plugin.dll 105KB
libplaylist_plugin.dll 104KB
libogg_plugin.dll 99KB
libkate_plugin.dll 96KB
libmpc_plugin.dll 94KB
libaccess_bd_plugin.dll 92KB
libavi_plugin.dll 90KB
libaccess_http_plugin.dll 90KB
libpacketizer_h264_plugin.dll 85KB
libpostproc_plugin.dll 84KB
libsap_plugin.dll 83KB
libzip_plugin.dll 82KB
libaccess_mms_plugin.dll 78KB
libi420_rgb_mmx_plugin.dll 76KB
libasf_plugin.dll 72KB
libaccess_realrtsp_plugin.dll 71KB
liboldrc_plugin.dll 70KB
libdirectx_plugin.dll 69KB
libstream_out_transcode_plugin.dll 69KB
libdirect3d_plugin.dll 69KB
liba52tofloat32_plugin.dll 68KB
libglwin32_plugin.dll 67KB
libvisual_plugin.dll 64KB
libvod_rtsp_plugin.dll 58KB
libpanoramix_plugin.dll 56KB
libty_plugin.dll 56KB
libpacketizer_mpeg4audio_plugin.dll 56KB
libi420_rgb_plugin.dll 55KB
libwingdi_plugin.dll 55KB
共 340 条
- 1
- 2
- 3
- 4
angel_boom
- 粉丝: 1
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于双向 LSTM 中文微博情感分类项目功能实现
- PHP新闻管理系统设计与实现 毕业设计
- STM32单片机FPGA毕设电路原理论文报告汽车电动助力转向单片机控制系统设计与试验研究
- STM32单片机FPGA毕设电路原理论文报告气压传感器神经网络算法及单片机实现
- 西南交大-大学物理A作业-2019-带参考答案
- c++语言大作业,校区人员管理系统framework.zip
- 多目标优化算法集合,包含使用手册
- c语言程序设计大作业 课程设计 高分大作业98分.zip
- STM32单片机FPGA毕设电路原理论文报告频率的测量在单片机设计中的应用
- 音频转码工具(用于将微信语音 amr 格式转换为 mp3 格式以便在 html5 的 audio 标签中进行播放).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页