forked from misakamm/xege
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
部分重构 IMAGE 类 #28
Merged
Merged
部分重构 IMAGE 类 #28
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
现可提前调用 `ege::newimage`
创建的 Bitmap 至少为 1x1,传入的长宽值则被截取到 0 或以上
所以, 在此基础之上, 如果开放 ege::Image 这个类, 会有什么问题吗, 要不把这个也支持了? |
举个例子: int main()
{
ege::Image img;
initgraph(WIDTH, HEIGHT);
// ...
} 像这样的代码, 在之前的版本是错误的, 加上这次PR之后, 能让它正确吗 |
可以是可以,但 |
ok, 后面有计划放出来么。。。 cpp 还是应该有cpp的样子, 感觉放出来的话, 会好用不少 |
不过放出来的话就得多测一下了 |
尤其是很多萌新喜欢用全局变量...
|
可以做,但我今年之后可能没什么时间了,我想留到下个版本解决。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
把
IMAGE::newimage
一坨代码重构了。IMAGE
就是管理内存设备上下文(DC)的类,可以直接通过GetDC(NULL)
得到屏幕 DC,然后用它建立内存 DC,因此不用先调用initgraph
建立窗口。关键 commit 是 04c1ae1。
无长宽参数时默认建立 1×1 大小的
IMAGE
对象保持不变,但允许建立长或宽为 0 的IMAGE
对象以及将IMAGE
对象的长或宽resize
到 0 大小。