将位图分为三部分

石院情歌小王子 2018-10-24 11:29:35

如图,MFC中将三个类放置在一张位图上,三个类绘制好后放入位图中同时显示,求思路,求赐教
...全文
119 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2018-10-25
  • 打赏
  • 举报
回复
CSplitterWnd


The CSplitterWnd class provides the functionality of a splitter window, which is a window that contains multiple panes. A pane is usually an application-specific object derived from CView, but it can be any CWnd object that has the appropriate child window ID.

A CSplitterWnd object is usually embedded in a parent CFrameWnd or CMDIChildWnd object. Create a CSplitterWnd object using the following steps:

Embed a CSplitterWnd member variable in the parent frame.


Override the parent frame’s CFrameWnd::OnCreateClient member function.


From within the overridden OnCreateClient, call the Create or CreateStatic member function of CSplitterWnd.
Call the Create member function to create a dynamic splitter window. A dynamic splitter window typically is used to create and scroll a number of individual panes, or views, of the same document. The framework automatically creates an initial pane for the splitter; then the framework creates, resizes, and disposes of additional panes as the user operates the splitter window’s controls.

When you call Create, you specify a minimum row height and column width that determine when the panes are too small to be fully displayed. After you call Create, you can adjust these minimums by calling the SetColumnInfo and SetRowInfo member functions.

Also use the SetColumnInfo and SetRowInfo member functions to set an “ideal” width for a column and “ideal” height for a row. When the framework displays a splitter window, it first displays the parent frame, then the splitter window. The framework then lays out the panes in columns and rows according to their ideal dimensions, working from the upper-left to the lower-right corner of the splitter window’s client area.

All panes in a dynamic splitter window must be of the same class. Familiar applications that support dynamic splitter windows include Microsoft Word and Microsoft Excel.

Use the CreateStatic member function to create a static splitter window. The user can change only the size of the panes in a static splitter window, not their number or order.

You must specifically create all the static splitter’s panes when you create the static splitter. Make sure you create all the panes before the parent frame’s OnCreateClient member function returns, or the framework will not display the window correctly.

The CreateStatic member function automatically initializes a static splitter with a minimum row height and column width of 0. After you call Create, adjust these minimums by calling the SetColumnInfo and SetRowInfo member functions. Also use SetColumnInfo and SetRowInfo after you call CreateStatic to indicate desired ideal pane dimensions.

The individual panes of a static splitter often belong to different classes. For examples of static splitter windows, see the graphics editor and the Windows File Manager.

A splitter window supports special scroll bars (apart from the scroll bars that panes may have). These scroll bars are children of the CSplitterWnd object and are shared with the panes.

You create these special scroll bars when you create the splitter window. For example, a CSplitterWnd that has one row, two columns, and the WS_VSCROLL style will display a vertical scroll bar that is shared by the two panes. When the user moves the scroll bar, WM_VSCROLL messages are sent to both panes. When the panes set the scroll-bar position, the shared scroll bar is set.

For further information on splitter windows, see Technical Note 29. For more information on how to create dynamic splitter windows, see Adding Splitter Windows to Scribble inEnhancing Views in Visual C++ Tutorials, and the MFC General sampleVIEWEX.

#include <afxext.h>

Class Members | Base Class | Hierarchy Chart

Sample MFC Sample VIEWEX

See Also CView, CWnd
赵4老师 2018-10-25
  • 打赏
  • 举报
回复
Coordinate Space and Transformation Functions
The following functions are used with coordinate spaces and transformations.



ClientToScreen
CombineTransform
DPtoLP
GetCurrentPositionEx
GetGraphicsMode
GetMapMode
GetViewportExtEx
GetViewportOrgEx
GetWindowExtEx
GetWindowOrgEx
GetWorldTransform
LPtoDP
MapWindowPoints
ModifyWorldTransform
OffsetViewportOrgEx
OffsetWindowOrgEx
ScaleViewportExtEx
ScaleWindowExtEx
ScreenToClient
SetGraphicsMode
SetMapMode
SetViewportExtEx
SetViewportOrgEx
SetWindowExtEx
SetWindowOrgEx
SetWorldTransform



赵4老师 2018-10-25
  • 打赏
  • 举报
回复
Bitmap Functions
The following functions are used with bitmaps.



AlphaBlend
BitBlt
CreateBitmap
CreateBitmapIndirect
CreateCompatibleBitmap
CreateDIBitmap
CreateDIBSection
ExtFloodFill
GetBitmapDimensionEx
GetDIBColorTable
GetDIBits
GetPixel
GetStretchBltMode
GradientFill
MaskBlt
PlgBlt
SetBitmapDimensionEx
SetDIBColorTable
SetDIBits
SetDIBitsToDevice
SetPixel
SetPixelV
SetStretchBltMode
StretchBlt
StretchDIBits
TransparentBlt
CT8100 2018-10-25
  • 打赏
  • 举报
回复
引用 7 楼 qq_33185566 的回复:
[quote=引用 5 楼 iloveyou418 的回复:]
BitBlt HDC截取。想要什么姿势都可以。。。

你好,我没有使用过BitBlt,请问他可以实现如图的效果吗,思路是什么呢?谢谢
[/quote]这个效果可以用StretchBlt

oblivi 2018-10-24
  • 打赏
  • 举报
回复
WM_MOUSEMOVE,记录你鼠标的坐标,鼠标每拖动一次都强制刷新一次,WM_PAINT里面StretchBlt,记得SetStretchBltMode,不然图片会失真很严重
ruan1978 2018-10-24
  • 打赏
  • 举报
回复
你这个图片是何格式?分析图片里的数据去提取。
  • 打赏
  • 举报
回复
引用 5 楼 iloveyou418 的回复:
BitBlt HDC截取。想要什么姿势都可以。。。

你好,我没有使用过BitBlt,请问他可以实现如图的效果吗,思路是什么呢?谢谢
  • 打赏
  • 举报
回复
引用 3 楼 zhao4zhong1 的回复:
BitBlt

你好,我没有使用过BitBlt,请问他可以实现如图的效果吗,思路是什么呢?谢谢
CT8100 2018-10-24
  • 打赏
  • 举报
回复
BitBlt HDC截取。想要什么姿势都可以。。。
smwhotjay 2018-10-24
  • 打赏
  • 举报
回复

绘制完了这3个图写入位图?
赵4老师 2018-10-24
  • 打赏
  • 举报
回复
BitBlt
  • 打赏
  • 举报
回复
不是,可能误会我意思了,我是说将数据画到位图上显示,但是如何让他像图里一样分为三部分

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

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