几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】i want to change the backgroundcolor in viewing (http://www.dimcax.com/hust/showthread.php?t=16828)

yang686526 2009-05-06 03:34 PM

【转帖】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().


所有的时间均为北京时间。 现在的时间是 11:33 AM.