本文介绍了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功能
发布评论