Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #5039 > unrolled thread

Draw half-opaque polygon w/o additional products? (API only)

Started byStefan Ungemach <stefan.ungemach@bingo-ev.de>
First post2013-04-12 09:12 -0700
Last post2013-04-15 10:53 -0700
Articles 13 — 5 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Draw half-opaque polygon w/o additional products? (API only) Stefan Ungemach <stefan.ungemach@bingo-ev.de> - 2013-04-12 09:12 -0700
    Re: Draw half-opaque polygon w/o additional products? (API only) "Er!k \\/!$$Er" <nospam@nospam.url> - 2013-04-12 19:28 +0200
      Re: Draw half-opaque polygon w/o additional products? (API only) "Willie Moore" <williem@wmconsulting.com> - 2013-04-12 13:41 -0500
        Re: Draw half-opaque polygon w/o additional products? (API only) "Er!k \\/!$$Er" <nospam@nospam.url> - 2013-04-12 23:01 +0200
          Re: Draw half-opaque polygon w/o additional products? (API only) Stefan Ungemach <stefan.ungemach@bingo-ev.de> - 2013-04-13 00:25 -0700
            Re: Draw half-opaque polygon w/o additional products? (API only) "Er!k \\/!$$Er" <nospam@nospam.url> - 2013-04-13 09:41 +0200
    Re: Draw half-opaque polygon w/o additional products? (API only) Stefan Ungemach <stefan.ungemach@bingo-ev.de> - 2013-04-12 12:35 -0700
      Re: Draw half-opaque polygon w/o additional products? (API only) "Er!k \\/!$$Er" <nospam@nospam.url> - 2013-04-12 22:56 +0200
    Re: Draw half-opaque polygon w/o additional products? (API only) Stefan Ungemach <stefan.ungemach@bingo-ev.de> - 2013-04-13 06:14 -0700
      Re: Draw half-opaque polygon w/o additional products? (API only) "Er!k \\/!$$Er" <nospam@nospam.url> - 2013-04-14 18:57 +0200
      Re: Draw half-opaque polygon w/o additional products? (API only) "Er!k \\/!$$Er" <nospam@nospam.url> - 2013-04-14 19:01 +0200
      Re: Draw half-opaque polygon w/o additional products? (API only) "Arne Ortlinghaus" <Arne.Ortlinghaus@acs.it> - 2013-04-15 09:19 +0200
    Re: Draw half-opaque polygon w/o additional products? (API only) Gustavo Biasone <rosario.soft@gmail.com> - 2013-04-15 10:53 -0700

#5039 — Draw half-opaque polygon w/o additional products? (API only)

FromStefan Ungemach <stefan.ungemach@bingo-ev.de>
Date2013-04-12 09:12 -0700
SubjectDraw half-opaque polygon w/o additional products? (API only)
Message-ID<7356782c-2d78-4a7d-a005-38539a5304ba@googlegroups.com>
Hi,

does anybody have an idea how to draw a semi-transparent polygon in a DC? I am drawing all kinds of basic forms using TextObject, RectangleObject etc. and even did write an own PolygonObject class inheriting from DrawObject - but I need to draw these forms half opaque. Actually I can only draw them transparent or solid. Can somebody help me?

And please - do NOT post another hint like using Graphics4VO or something similar. I KNOW the product and even own it, but I cannot use it since it relies on subclassed windows who have some other characteristics I cannot use (i.e. I have to lay some bitmaps on them as a background, and doing so many times causes memory leaks). I had my reasons to use DrawObjects in my code, it is NO option to change it bottom up, basic disussions like they are often initiated by Geoff & Co. do NOT help me -  so please just accept it and help me using the API.


TIA
Stefan

[toc] | [next] | [standalone]


#5040

From"Er!k \\/!$$Er" <nospam@nospam.url>
Date2013-04-12 19:28 +0200
Message-ID<asquhvF73mtU1@mid.individual.net>
In reply to#5039
Hi Stephan,
I did a session about polygons in London and Cologne about polygons.
Did a search and found the demo material.  This should get you started.

Here a screenshot of how I use this in practize
http://cport.nl/cPort/clip0011.zoom80.jpg

Drop me an email and I send you an AEF. (see contactdetails on the website) 
It is all VO2.7 code, but you should not have much trouble getting it to 
work in VO2.8
Most interesting part (IMO) is the draw method. It contains a way to 
dynamicly create dim-array's. Thanks to Frans de Wit I was able to implement 
this.

Hope this suits your needs,

Erik




"Stefan Ungemach"  schreef in bericht 
news:7356782c-2d78-4a7d-a005-38539a5304ba@googlegroups.com...

Hi,

does anybody have an idea how to draw a semi-transparent polygon in a DC? I 
am drawing all kinds of basic forms using TextObject, RectangleObject etc. 
and even did write an own PolygonObject class inheriting from DrawObject - 
but I need to draw these forms half opaque. Actually I can only draw them 
transparent or solid. Can somebody help me?

And please - do NOT post another hint like using Graphics4VO or something 
similar. I KNOW the product and even own it, but I cannot use it since it 
relies on subclassed windows who have some other characteristics I cannot 
use (i.e. I have to lay some bitmaps on them as a background, and doing so 
many times causes memory leaks). I had my reasons to use DrawObjects in my 
code, it is NO option to change it bottom up, basic disussions like they are 
often initiated by Geoff & Co. do NOT help me -  so please just accept it 
and help me using the API.


TIA
Stefan 

[toc] | [prev] | [next] | [standalone]


#5041

From"Willie Moore" <williem@wmconsulting.com>
Date2013-04-12 13:41 -0500
Message-ID<kk9kh9$5vb$1@speranza.aioe.org>
In reply to#5040
Erik,

Your session was very good too! I ended up implementing my polyogns 
differently but it was a huge head start to see some code and not just the 
VB 6 I was given.

Regards,
Willie
Vulcan VIP 

[toc] | [prev] | [next] | [standalone]


#5044

From"Er!k \\/!$$Er" <nospam@nospam.url>
Date2013-04-12 23:01 +0200
Message-ID<asrb0uF9vsfU1@mid.individual.net>
In reply to#5041
Thanks! 

Erik

"Willie Moore"  schreef in bericht news:kk9kh9$5vb$1@speranza.aioe.org... 

Erik,

Your session was very good too! I ended up implementing my polyogns 
differently but it was a huge head start to see some code and not just the 
VB 6 I was given.

Regards,
Willie
Vulcan VIP 

[toc] | [prev] | [next] | [standalone]


#5045

FromStefan Ungemach <stefan.ungemach@bingo-ev.de>
Date2013-04-13 00:25 -0700
Message-ID<4a34ebf8-0c0c-4097-b980-680e0e9cf2d2@googlegroups.com>
In reply to#5044
Erik,

sounds even greater. But unfortunately I don't have your email address; mine is stefan.ungemach(at)bingo-ev.de

TIA
Stefan

[toc] | [prev] | [next] | [standalone]


#5046

From"Er!k \\/!$$Er" <nospam@nospam.url>
Date2013-04-13 09:41 +0200
Message-ID<assgghFhd9jU1@mid.individual.net>
In reply to#5045
Stefan,

Check your email.

Erik



"Stefan Ungemach"  schreef in bericht 
news:4a34ebf8-0c0c-4097-b980-680e0e9cf2d2@googlegroups.com...

Erik,

sounds even greater. But unfortunately I don't have your email address; mine 
is stefan.ungemach(at)bingo-ev.de

TIA
Stefan 

[toc] | [prev] | [next] | [standalone]


#5042

FromStefan Ungemach <stefan.ungemach@bingo-ev.de>
Date2013-04-12 12:35 -0700
Message-ID<8de29515-5006-4de0-a8fe-d810b6df09ee@googlegroups.com>
In reply to#5039
Am Freitag, 12. April 2013 18:12:16 UTC+2 schrieb Stefan Ungemach:
> Hi,
> 
> 
> 
> does anybody have an idea how to draw a semi-transparent polygon in a DC? I am drawing all kinds of basic forms using TextObject, RectangleObject etc. and even did write an own PolygonObject class inheriting from DrawObject - but I need to draw these forms half opaque. Actually I can only draw them transparent or solid. Can somebody help me?
> 
> 
> 
> And please - do NOT post another hint like using Graphics4VO or something similar. I KNOW the product and even own it, but I cannot use it since it relies on subclassed windows who have some other characteristics I cannot use (i.e. I have to lay some bitmaps on them as a background, and doing so many times causes memory leaks). I had my reasons to use DrawObjects in my code, it is NO option to change it bottom up, basic disussions like they are often initiated by Geoff & Co. do NOT help me -  so please just accept it and help me using the API.
> 
> 
> 
> 
> 
> TIA
> 
> Stefan

Hi Erik,

this would be great - but can you also implement HALF-opaque shapes (which means: a little bit transparent, as to say "colour shaded")? Your example looks like a fully solid polygon.

Let me explain my concrete problem. I draw terrain maps which are dynamically generated from elevation data. They look like 3d shaded images of mountains and valleys. Now I want to implement airspace overlays, but the details of the maps and waypoints still need to be seen beneath these layers. Do you think your approach can help me with this task?


Cheers
Stefan

[toc] | [prev] | [next] | [standalone]


#5043

From"Er!k \\/!$$Er" <nospam@nospam.url>
Date2013-04-12 22:56 +0200
Message-ID<asran6F9tpfU1@mid.individual.net>
In reply to#5042
Stefan,

>  but can you also implement HALF-opaque shapes
Yes they are! They are kind of transparant and the color also changes when 
the background color changes.
The sample also containse rotation of the polygon and a very fast and 
acurate hittest.

Just drop me and email..

Erik




"Stefan Ungemach"  schreef in bericht 
news:8de29515-5006-4de0-a8fe-d810b6df09ee@googlegroups.com...

Am Freitag, 12. April 2013 18:12:16 UTC+2 schrieb Stefan Ungemach:
> Hi,
>
>
>
> does anybody have an idea how to draw a semi-transparent polygon in a DC? 
> I am drawing all kinds of basic forms using TextObject, RectangleObject 
> etc. and even did write an own PolygonObject class inheriting from 
> DrawObject - but I need to draw these forms half opaque. Actually I can 
> only draw them transparent or solid. Can somebody help me?
>
>
>
> And please - do NOT post another hint like using Graphics4VO or something 
> similar. I KNOW the product and even own it, but I cannot use it since it 
> relies on subclassed windows who have some other characteristics I cannot 
> use (i.e. I have to lay some bitmaps on them as a background, and doing so 
> many times causes memory leaks). I had my reasons to use DrawObjects in my 
> code, it is NO option to change it bottom up, basic disussions like they 
> are often initiated by Geoff & Co. do NOT help me -  so please just accept 
> it and help me using the API.
>
>
>
>
>
> TIA
>
> Stefan

Hi Erik,

this would be great - but can you also implement HALF-opaque shapes (which 
means: a little bit transparent, as to say "colour shaded")? Your example 
looks like a fully solid polygon.

Let me explain my concrete problem. I draw terrain maps which are 
dynamically generated from elevation data. They look like 3d shaded images 
of mountains and valleys. Now I want to implement airspace overlays, but the 
details of the maps and waypoints still need to be seen beneath these 
layers. Do you think your approach can help me with this task?


Cheers
Stefan 

[toc] | [prev] | [next] | [standalone]


#5047

FromStefan Ungemach <stefan.ungemach@bingo-ev.de>
Date2013-04-13 06:14 -0700
Message-ID<b25b94d6-c1a5-48fc-ace0-4e4d6cee1db0@googlegroups.com>
In reply to#5039
Am Freitag, 12. April 2013 18:12:16 UTC+2 schrieb Stefan Ungemach:
> Hi,
> 
> 
> 
> does anybody have an idea how to draw a semi-transparent polygon in a DC? I am drawing all kinds of basic forms using TextObject, RectangleObject etc. and even did write an own PolygonObject class inheriting from DrawObject - but I need to draw these forms half opaque. Actually I can only draw them transparent or solid. Can somebody help me?
> 
> 
> 
> And please - do NOT post another hint like using Graphics4VO or something similar. I KNOW the product and even own it, but I cannot use it since it relies on subclassed windows who have some other characteristics I cannot use (i.e. I have to lay some bitmaps on them as a background, and doing so many times causes memory leaks). I had my reasons to use DrawObjects in my code, it is NO option to change it bottom up, basic disussions like they are often initiated by Geoff & Co. do NOT help me -  so please just accept it and help me using the API.
> 
> 
> 
> 
> 
> TIA
> 
> Stefan

Thanks Erik,

I've tested your examples. Unfortunately they don't help me with my problem. I don't want some simple inversiopn of underlying pixels but more some kind of alpha-blending - like as if someone lays a colored foil over an image. Could that be achieved with your code, too (the onyl point could be the Init method of the polygon class, but I'm afraid that the constants there won't suit my needs)?

Kind regards
Stefan

[toc] | [prev] | [next] | [standalone]


#5051

From"Er!k \\/!$$Er" <nospam@nospam.url>
Date2013-04-14 18:57 +0200
Message-ID<at05f1Fbn1vU1@mid.individual.net>
In reply to#5047
Hi Stephan,

Sorry this sample does not work for your needs.
It suites me, so I never studied further to get other results.
(Ofcource you could try the different constants to see if they give you the 
result you need, but I guess you came up with that idea yourself)
Another thing you could do is search on the internet for c-code that uses 
the polygon function that does what you want and rewrite it into VO.


regards,

Erik



"Stefan Ungemach"  schreef in bericht 
news:b25b94d6-c1a5-48fc-ace0-4e4d6cee1db0@googlegroups.com...

Am Freitag, 12. April 2013 18:12:16 UTC+2 schrieb Stefan Ungemach:
> Hi,
>
>
>
> does anybody have an idea how to draw a semi-transparent polygon in a DC? 
> I am drawing all kinds of basic forms using TextObject, RectangleObject 
> etc. and even did write an own PolygonObject class inheriting from 
> DrawObject - but I need to draw these forms half opaque. Actually I can 
> only draw them transparent or solid. Can somebody help me?
>
>
>
> And please - do NOT post another hint like using Graphics4VO or something 
> similar. I KNOW the product and even own it, but I cannot use it since it 
> relies on subclassed windows who have some other characteristics I cannot 
> use (i.e. I have to lay some bitmaps on them as a background, and doing so 
> many times causes memory leaks). I had my reasons to use DrawObjects in my 
> code, it is NO option to change it bottom up, basic disussions like they 
> are often initiated by Geoff & Co. do NOT help me -  so please just accept 
> it and help me using the API.
>
>
>
>
>
> TIA
>
> Stefan

Thanks Erik,

I've tested your examples. Unfortunately they don't help me with my problem. 
I don't want some simple inversiopn of underlying pixels but more some kind 
of alpha-blending - like as if someone lays a colored foil over an image. 
Could that be achieved with your code, too (the onyl point could be the Init 
method of the polygon class, but I'm afraid that the constants there won't 
suit my needs)?

Kind regards
Stefan 

[toc] | [prev] | [next] | [standalone]


#5052

From"Er!k \\/!$$Er" <nospam@nospam.url>
Date2013-04-14 19:01 +0200
Message-ID<at05o2FbourU1@mid.individual.net>
In reply to#5047
Perhaps this comes closer:
http://www.progtown.com/topic843513-drawing-of-translucent-polygons-win32-api.html

Erik

"Stefan Ungemach"  schreef in bericht 
news:b25b94d6-c1a5-48fc-ace0-4e4d6cee1db0@googlegroups.com...

Am Freitag, 12. April 2013 18:12:16 UTC+2 schrieb Stefan Ungemach:
> Hi,
>
>
>
> does anybody have an idea how to draw a semi-transparent polygon in a DC? 
> I am drawing all kinds of basic forms using TextObject, RectangleObject 
> etc. and even did write an own PolygonObject class inheriting from 
> DrawObject - but I need to draw these forms half opaque. Actually I can 
> only draw them transparent or solid. Can somebody help me?
>
>
>
> And please - do NOT post another hint like using Graphics4VO or something 
> similar. I KNOW the product and even own it, but I cannot use it since it 
> relies on subclassed windows who have some other characteristics I cannot 
> use (i.e. I have to lay some bitmaps on them as a background, and doing so 
> many times causes memory leaks). I had my reasons to use DrawObjects in my 
> code, it is NO option to change it bottom up, basic disussions like they 
> are often initiated by Geoff & Co. do NOT help me -  so please just accept 
> it and help me using the API.
>
>
>
>
>
> TIA
>
> Stefan

Thanks Erik,

I've tested your examples. Unfortunately they don't help me with my problem. 
I don't want some simple inversiopn of underlying pixels but more some kind 
of alpha-blending - like as if someone lays a colored foil over an image. 
Could that be achieved with your code, too (the onyl point could be the Init 
method of the polygon class, but I'm afraid that the constants there won't 
suit my needs)?

Kind regards
Stefan 

[toc] | [prev] | [next] | [standalone]


#5057

From"Arne Ortlinghaus" <Arne.Ortlinghaus@acs.it>
Date2013-04-15 09:19 +0200
Message-ID<kkg9fv$7cg$1@dont-email.me>
In reply to#5047
Hello Stefan,

Willie Moore found some code examples for using GDI++ called via C-DLL-API 
and not via C++ objects. In fact GDI++ is written in C although the official 
API is the C++ API.

I have not tried until yet but there seem to be so many possibilities with 
GDI++ that are missing in normal GDI.

Google for "Use_GDI+_(1627568102003"

Arne Ortlinghaus


"Stefan Ungemach" <stefan.ungemach@bingo-ev.de> schrieb im Newsbeitrag 
news:b25b94d6-c1a5-48fc-ace0-4e4d6cee1db0@googlegroups.com...
Am Freitag, 12. April 2013 18:12:16 UTC+2 schrieb Stefan Ungemach:
> Hi,
>
>
>
> does anybody have an idea how to draw a semi-transparent polygon in a DC? 
> I am drawing all kinds of basic forms using TextObject, RectangleObject 
> etc. and even did write an own PolygonObject class inheriting from 
> DrawObject - but I need to draw these forms half opaque. Actually I can 
> only draw them transparent or solid. Can somebody help me?
>
>
>
> And please - do NOT post another hint like using Graphics4VO or something 
> similar. I KNOW the product and even own it, but I cannot use it since it 
> relies on subclassed windows who have some other characteristics I cannot 
> use (i.e. I have to lay some bitmaps on them as a background, and doing so 
> many times causes memory leaks). I had my reasons to use DrawObjects in my 
> code, it is NO option to change it bottom up, basic disussions like they 
> are often initiated by Geoff & Co. do NOT help me -  so please just accept 
> it and help me using the API.
>
>
>
>
>
> TIA
>
> Stefan

Thanks Erik,

I've tested your examples. Unfortunately they don't help me with my problem. 
I don't want some simple inversiopn of underlying pixels but more some kind 
of alpha-blending - like as if someone lays a colored foil over an image. 
Could that be achieved with your code, too (the onyl point could be the Init 
method of the polygon class, but I'm afraid that the constants there won't 
suit my needs)?

Kind regards
Stefan 

[toc] | [prev] | [next] | [standalone]


#5061

FromGustavo Biasone <rosario.soft@gmail.com>
Date2013-04-15 10:53 -0700
Message-ID<0fe42464-5b00-4b79-b426-21336e0b6a19@googlegroups.com>
In reply to#5039
Hi Stefan,

It is possible by using GDI+ flat functions.
I'm using it and works like a charm. 
The most difficult part is VO _DLL function wrappers, as there are some differences with parameter types, etc.
I'm working in a class that encapsulates all kind of shapes drawing.
If you need some help with that just drop me an email (rosario dot soft at gmail dot com)

HTH
Gustavo Biasone

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web