查看单个帖子
旧 2009-05-06, 03:34 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】i want to change the backgroundcolor in viewing

i want to change the backgroundcolor in viewing.
i want to change the backgroundcolor in viewing.
hi,
if(m_bbgwhite)
{
m_pdevice->setlogicalpalette(odcmacadpalette(odrgb(255,255,2 55)), 256);
m_pdevice->setbackgroundcolor(odrgb(255,255,255));
// setpalettebackground(odrgb(255,255,255));
}
else
{
m_pdevice->setlogicalpalette(odcmacadpalette(odrgb(0,0,0)) , 256);
m_pdevice->setbackgroundcolor(odrgb(0,0,0));
// setpalettebackground(odrgb(0,0,0));
}
is this correct??
it works well in model space but paper space dosen't.
let me know how to change backgroundcolor.
attached images

hi,
code from odamfcapp:
quote:
const odcolorref* palette = theapp.curpalette();
odgspalette ppalcpy;
ppalcpy.insert(ppalcpy.begin(), palette, palette+256);
ppalcpy[0] = theapp.activebackground();
m_pdevice->setlogicalpalette(ppalcpy.asarrayptr(), 256);
odgspaperlayouthelperptr ppshelper = odgspaperlayouthelper::cast(m_pdevice);
if(ppshelper.isnull())
{
m_bpsoverall = false;
m_pdevice->setbackgroundcolor(ppalcpy[0]); // for model space
}
else
{
m_bpsoverall = (ppshelper->overallview().get() == ppshelper->activeview().get());
m_pdevice->setbackgroundcolor(odrgb(173,174,173)); // acad's color for paper bg
}
odgicontextfordbdatabase *pctx = this;
pctx->setpalettebackground(theapp.activebackground()) ;
the background color for paperspace is not a paper color - this is a background for paper color.
set additionally background color using odgicontextfordbdatabase::setpalettebackground().
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)