Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 06-01-2014, 13:44   #1
Registered User

Join Date: May 2012
Posts: 407
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:	85
Size:	9.4 KB
ID:	73403   Click image for larger version

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

__________________
Rasbats is offline   Reply With Quote
Old 06-01-2014, 23:11   #2
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: Masachusetts
Boat: bristol 27
Posts: 2,803
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.
__________________
boat_alexandra is offline   Reply With Quote
Old 08-01-2014, 08:26   #3
Registered User

Join Date: May 2012
Posts: 407
Re: Plugins: OpenGL and text

Many thanks Sean,

statusbar_pi solved the transparency problem.

Mike
__________________
Rasbats is offline   Reply With Quote
Reply

Tags
plug

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 06:54.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.