embarcadero构建器中的C ++ Scanline功能

编程入门 行业动态 更新时间:2024-10-28 17:25:33
本文介绍了embarcadero构建器中的C ++ Scanline功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 嗯..我以为我理解了扫描线......但是当我单步执行代码时,源指针仍为空,并且传输了nothng。我有什么建议,我在听。 这是我的代码的核心,我希望在读写之间做像素,但这部分不起作用,我不知道为什么。

void TDriverFrm :: MoveBmp(Graphics :: TBitmap * Dest,Graphics: :TBitmap *来源,TColor颜色) { int x,y; TRGBTriple * Sbyte,* Dbyte; for (y = 0 ; y< TILEDIM; y ++){ Sbyte =(TRGBTriple *)Source-> ScanLine [y]; Dbyte =(TRGBTriple *)Dest-> ScanLine [y]; for (x = 0 ; x< TILEDIM; x ++){ Dbyte [x] = Sbyte [x]; } } }

解决方案

我在大约5年内没有触及C ++我从来没有听说过Embarcadero,但是......看起来你的演员被应用到了错误的项目上。不应该是这样的:

Sbyte =(TRBGTriple *)(Source-> scanline [y]);

Um.. I thought I understood scan line... but when I step through the code, the source pointer remains empty and nothng gets transferred. I you have any advice, I'm listening. this is the core of my code, I'm hoping to do stuff to the pixels between reading and writing, but this part doesn't work, an I don't know why.

void TDriverFrm::MoveBmp(Graphics::TBitmap *Dest, Graphics::TBitmap *Source, TColor Color) { int x,y; TRGBTriple *Sbyte, *Dbyte; for(y=0; y<TILEDIM; y++){ Sbyte = (TRGBTriple *)Source->ScanLine[y]; Dbyte = (TRGBTriple *)Dest->ScanLine[y]; for(x=0; x<TILEDIM; x++){ Dbyte[x] = Sbyte[x]; } } }

解决方案

I haven't touched C++ in about 5 years and I've never even heard of Embarcadero, but... it looks like your cast is being applied to the wrong item. Shouldn't it be something like:

Sbyte = (TRBGTriple *)(Source->scanline[y]);

更多推荐

embarcadero构建器中的C ++ Scanline功能

本文发布于:2023-10-30 01:27:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1541362.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:器中   功能   embarcadero   Scanline

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!