Changeset 1899 in Sophya for trunk/SophyaPI/PI/pigraphx.cc
- Timestamp:
- Feb 13, 2002, 12:03:15 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pigraphx.cc
r1898 r1899 14 14 15 15 /* Variables globales pour modifier les GC */ 16 #define NMAXCOL 2416 #define NMAXCOL 32 17 17 static PIXColor colpix[NMAXCOL]; 18 18 … … 491 491 } 492 492 XPutImage(dsx, pxm2, gcbm, ximg2, 0, 0, 0, 0, fh, sw); 493 GC gcvis; 493 494 GC gcvs = XCreateGC (dsx, mWId, GCFunction | GCPlaneMask, &xgv); 494 495 XCopyGC(dsx, DefGC(), ~0, gcvs); 495 496 XSetStipple(dsx, gcvs, pxm2); 496 497 XSetFillStyle(dsx, gcvs, FillStippled); 498 if (imgs) { 499 gcvis = XCreateGC (dsx, mWId, GCFunction | GCPlaneMask, &xgv); 500 XCopyGC(dsx, DefGC(), ~0, gcvis); 501 if (mBCol == PI_ColorFromMap) XSetForeground(mDisp, gcvis, mBCfMap); 502 else XSetForeground(mDisp, gcvis, colpix[mBCol]); 503 } 497 504 if (fgdown) { 498 XSetTSOrigin(dsx, gcvs, x, y); 499 XFillRectangle(dsx, mWId, gcvs, x, y, fh, sw); 505 XSetTSOrigin(dsx, gcvs, x-fdes, y); 506 if (imgs) XFillRectangle(dsx, mWId, gcvis, x-fdes, y, fh, sw); 507 XFillRectangle(dsx, mWId, gcvs, x-fdes, y, fh, sw); 500 508 } 501 509 else { 502 XSetTSOrigin(dsx, gcvs, x-fh, y-sw); 503 XFillRectangle(dsx, mWId, gcvs, x-fh, y-sw, fh, sw); 510 XSetTSOrigin(dsx, gcvs, x-fasc, y-sw); 511 if (imgs) XFillRectangle(dsx, mWId, gcvis, x-fasc, y-sw, fh, sw); 512 XFillRectangle(dsx, mWId, gcvs, x-fasc, y-sw, fh, sw); 504 513 } 505 514 // Cleaning 506 515 XDestroyImage(ximg); 507 516 XDestroyImage(ximg2); 517 XFreeGC(dsx, gcbm); 508 518 XFreeGC(dsx, gcvs); 509 XFreeGC(dsx, gcbm);519 if (imgs) XFreeGC(dsx, gcvis); 510 520 XFreePixmap(dsx, pxm); 511 521 XFreePixmap(dsx, pxm2); … … 517 527 void PIGraphicX::SelForeground(PIColors col) 518 528 { 529 if (myLockFCol) return; 519 530 if (col == mFCol) return; 520 531 if ( (col < 0) || (col >= NMAXCOL)) return; … … 537 548 void PIGraphicX::SelForeground(PIColorMap& cmap, int cid) 538 549 { 550 if (myLockFCol) return; 539 551 SelectFCol(cmap.Color(cid)); 540 552 } … … 849 861 colpix[PI_DarkViolet] = mycol.pixel; 850 862 863 mycol.red = 0; 864 mycol.blue = 65000; 865 mycol.green = 45000; 866 if ( XAllocColor (mdsp, cmap, &mycol) ) colpix[PI_HighlightBlue] = mycol.pixel; 851 867 852 868 /* le GC pour DrawPixmap */
Note:
See TracChangeset
for help on using the changeset viewer.