再问一遍,怎么才能获得一幅图像的指针

amartapple 2002-11-12 10:22:53
Image->Picture->Bitmap,可以返回一个指向一幅图像的Bitmap*,但是这并不方便(也许是我无知),我想得到一个指向这幅图像的整形指针,
这样我就可以通过加上头文件来获得指向图像象素的指针,从而可以通过家加减减,就可以从容的在图像中移动指针来获得个个像素

不知我的想法对不对,如果你能通过别的方法实现也可以告诉我
不过,Pixle[i][j]的和ScanLine的就不用了,太慢
...全文
38 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
iec 2002-12-06
  • 打赏
  • 举报
回复
ok
amartapple 2002-11-15
  • 打赏
  • 举报
回复
呵呵,谁还有办法,有人告诉我读DC,但是我不会,谁能说一下
amartapple 2002-11-14
  • 打赏
  • 举报
回复
up
amartapple 2002-11-13
  • 打赏
  • 举报
回复
这是从帮助中查到的,和上面的不一样,请讲一下吧,再就是怎么移动指针获得不同的像素
Returns the persistent object with the name passed as a parameter.

virtual Classes::TPersistent* __fastcall GetObject(const AnsiString Name) = 0;

Description

Call GetObject to access a persistent object given its name. This is useful when working with components that include constituent objects such as the TStatusPanel objects that are used by TStatusBar.

To obtain the name of a persistent object, use the GetObjectName method.
amartapple 2002-11-13
  • 打赏
  • 举报
回复
谢谢
up一下
iec 2002-11-13
  • 打赏
  • 举报
回复
GetObject()
ThinkX 2002-11-13
  • 打赏
  • 举报
回复
::GetObject(..)
jishiping 2002-11-13
  • 打赏
  • 举报
回复
查看Bitmap图象格式的书籍。
amartapple 2002-11-13
  • 打赏
  • 举报
回复
从什么资料可以找到
jishiping 2002-11-13
  • 打赏
  • 举报
回复
我说的GetObject是API函数,而不是VCL的GetObject函数。至于怎么移动指针,怎么给象素点赋值,你需要熟悉Bitmap的结构。这个不是1、2句话就说得清楚的,已经是另外一个话题了。
ThinkX 2002-11-12
  • 打赏
  • 举报
回复
斑竹回答的很好。这么访问很快,就是容易出界,另外,一般的bmp图是在左下角为起点的(也有例外)。
jishiping 2002-11-12
  • 打赏
  • 举报
回复
可以用GetObject啊。
BITMAP Bmp;
GetObject(Image->Picture->Bitmap->Handle, sizeof(Bmp), &Bmp);
这样就可以通过 Bmp.bmBits 直接访问Bitmap的象素点了。

13,826

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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