About Memory DC's BitBlt(), that so complex for me.

sybaselu 2007-01-31 04:41:52
1 Suppose there are 3 lines texts for scrolling from bottom to top.
2 some clips source code be illustrated as follow:
ScrollStatic::OnPaint()
{
...
CPaintDC PaintDC(this);
MemDC dc(&PaintDC);
...
CRect rect;
GetClientRect(&rect);
for( int i = 0 ; i <3; i ++ )
{
...
dc.DrawText(..., rect, ... );
rect.top += Height_Of_Font;
}
}
I have been stucking in the a pices of code for servel days,so I have no chioces but to do for helping. in the loop of the function, to my pointview, the drawing process should be like this:
(top)
|
|
|
------------>

|
|
------------>

poxY
|
------------>posX
(bottom)
suppose "|" be represented by Hight_Of_Font and the direction of scroll is from bottom to top.
3 firstly, dc object be initialized with address of PaintDC, so
a memeory DC should be created in memory, the dimension of m_rect is alternative:left = 0, top = 0, height = xx, width = xx
my question is that
what's relationship between m_rect and rect?
how does BitBlt works?



...全文
206 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
sybaselu 2007-02-01
  • 打赏
  • 举报
回复
是这么想的,BitBlt(...)的本质是先用DrawText(...)在memory中先画好将要显示的stuff,当需要显示时, 然后一次性从memory中拷贝的screen的memory中,这样的好处就是避免边DrawText(),便于流畅显示,不会闪烁,抖动,毕竟便画,便显示,很好时。
sybaselu 2007-01-31
  • 打赏
  • 举报
回复
Whatever how many dc objects were created, the worth of left and top of m_rect are always equal 0 , on other hand, the value of Height() and Width() are always constant , why? so I think the block-bit data be copied from memory to rect
wormwormwormworm 2007-01-31
  • 打赏
  • 举报
回复
UP
内容概要:本文围绕基于Basisformer模型的时间序列锂离子电池SOC(State of Charge,荷电状态)预测展开研究,利用PyTorch框架实现深度学习模型的构建与训练。通过将历史充放电数据作为输入,Basisformer能够有效捕捉电池状态的动态变化特征,提升SOC预测精度。文中详细介绍了模型结构设计、数据预处理流程、训练策略及实验结果分析,并与传统方法进行对比,验证了该方法在复杂工况下的优越性与鲁棒性。该研究不仅展示了Basisformer在时序建模中的潜力,也为电池管理系统提供了高精度的状态估计解决方案。; 适合人群:具备一定Python编程基础和深度学习理论知识,熟悉PyTorch框架,从事电池管理系统、新能源汽车或智能预测方向研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①应用于电动汽车、储能系统等领域的电池SOC高精度实时估算;②为电池健康管理(BMS)提供可靠的状态输入;③推动深度学习在时间序列预测中的实际落地,提升现有预测模型的泛化能力与稳定性; 阅读建议:建议读者结合标题为【锂电池SOC估计】【PyTorch】基于Basisformer时间序列锂离子电池SOC预测研究(python代码实现)的资源,重点研读所提供的Python代码,深入理解数据处理方式与模型网络结构的设计思路,尝试调整超参数以观察对预测性能的影响,从而全面掌握Basisformer在时序建模中的优势、适用边界及工程化实现路径。

15,976

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧