|
From: Shigeharu T. <sh...@ie...> - 2008-10-10 10:36:50
|
shige 10/10 2008 ---------------- Ethan Merritt <merritt@u.washington.edu> wrote: | A bit of Googling suggests that the problem may be because we switched from | using CreatePenIndirect() to using ExtCreatePen(). Apparently some versions | of Windows have trouble with ExtCreatePen and the clipboard. Thank you for your information. The following patch forces wgnuplot to use CreatePenIndirect() if line_width==1. Certainly, the graph by "plot sin(x)" (made by CreatePenIndirect()) can be copied through the clipboard with no problem and the copying of the graph by "plot sin(x) lw 5" (made by ExtCreatePen()) loses the color, at least on my PC (MS-Windows XP). ----- From here ----- --- src/win/wgraph.c.ORG Thu Oct 9 08:23:00 2008 +++ src/win/wgraph.c Fri Oct 10 19:12:10 2008 @@ -939,13 +939,23 @@ if (line_width != 1) cur_penstruct.lopnWidth.x *= line_width; - /* use ExtCreatePeninstead of CreatePen/CreatePenIndirect to support + /* use ExtCreatePen instead of CreatePen/CreatePenIndirect to support * dashed lines if line_width > 1 */ lb.lbStyle = BS_SOLID; lb.lbColor = cur_penstruct.lopnColor; +/* shige */ +#if 0 lpgw->hapen = ExtCreatePen( (line_width==1 ? PS_COSMETIC : PS_GEOMETRIC) | cur_penstruct.lopnStyle | PS_ENDCAP_FLAT | PS_JOIN_BEVEL, cur_penstruct.lopnWidth.x, &lb, 0, 0); +#else + if (line_width==1) + lpgw->hapen = CreatePenIndirect((LOGPEN FAR *) &cur_penstruct); + else + lpgw->hapen = ExtCreatePen( + PS_GEOMETRIC | cur_penstruct.lopnStyle | PS_ENDCAP_FLAT | PS_JOIN_BEVEL, + cur_penstruct.lopnWidth.x, &lb, 0, 0); +#endif DeleteObject(SelectObject(hdc, lpgw->hapen)); SelectObject(hdc, lpgw->colorbrush[cur_pen]); ----- To here ----- +========================================================+ Shigeharu TAKENO NIigata Institute of Technology kashiwazaki,Niigata 945-1195 JAPAN sh...@ie... TEL(&FAX): +81-257-22-8161 +========================================================+ |