Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 06-01-2014, 12:44   #1
Registered User

Join Date: May 2012
Posts: 1,205
Plugins: OpenGL and text

I am trying to display text on a plugin viewport when in OpenGL mode.

The text should have a transparent background but I have not found a way of achieving this. The code here results in the first screenshot, with OpenGL selected. I need to produce a bitmap with a transparent background.

wxBrush backBrush(*wxTRANSPARENT_BRUSH);
wxMemoryDC mdc(wxNullBitmap);
wxBitmap bm(w + label_offset*2, h + 1);
mdc.SelectObject(bm);
mdc.Clear();
mdc.SetPen(penText);
mdc.SetBrush(backBrush);
mdc.SetTextForeground(text_color);
mdc.SetTextBackground(wxTRANSPARENT);

A second problem I have is drawing filled polygons with OpenGL on the viewport.

Is there any code in OpenCPN or one of the plugins that could point me in the right direction?

Thanks for looking.
Mike
Attached Thumbnails
Click image for larger version

Name:	OpenGL.jpg
Views:	160
Size:	9.4 KB
ID:	73403   Click image for larger version

Name:	Not_OpenGL.jpg
Views:	173
Size:	9.4 KB
ID:	73404  

Rasbats is offline   Reply With Quote
Old 06-01-2014, 22:11   #2
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,417
Re: Plugins: OpenGL and text

possibly check out my statusbar plugin

github.com/seandepagnier/statusbar_pi

text rendering also is implemented in s52plib.cpp in my fork of opencpn which is not actually official yet.
seandepagnier is offline   Reply With Quote
Old 08-01-2014, 07:26   #3
Registered User

Join Date: May 2012
Posts: 1,205
Re: Plugins: OpenGL and text

Many thanks Sean,

statusbar_pi solved the transparency problem.

Mike
Rasbats is offline   Reply With Quote
Reply

Tags
plug


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Advertise Here


All times are GMT -7. The time now is 23:37.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.