Pelles C forum

C language => Work in progress => Topic started by: frankie on May 17, 2016, 08:00:04 PM

Title: Another updated port to C of GDI+
Post by: frankie on May 17, 2016, 08:00:04 PM
The use of GDI+ is mainly limited because of the lacking of header to use the so called flat API's.
Searching around some hackings can be found, but they are old and in some cases limited.
I made a fast workout of last SDK and this is the result.
I'll look forward for comments and suggestions to make it a final release.

P.S. The test program of course is based on the historic GdiPlus demo.

EDIT: Removed some bugs and added 64bits version (see note in newer post).
EDIT: I forgot to put inside the fGdiPlus.h  >:(. Updated
EDIT: Updated version
Title: Re: Another updated port to C of GDI+
Post by: JohnF on May 18, 2016, 08:22:26 AM
Nice job with the header 'fGdiPlusFlat.h'

John
Title: Re: Another updated port to C of GDI+
Post by: frankie on May 18, 2016, 03:21:09 PM
Thanks John  :)
I have updated the project, I've found problems compiling for 64bits:
If somebody can check for other problems I'll be glad.
If there are no more problems I'll publish under contributions.
Title: Re: Another updated port to C of GDI+
Post by: JohnF on May 18, 2016, 03:53:00 PM
Yes you're right about malloc, well done.

John
Title: Re: Another updated port to C of GDI+
Post by: jj2007 on May 18, 2016, 09:25:05 PM
Can you post a link to fGdiPlusFlat.h?

http://forum.pellesc.de/index.php?topic=4165.msg21438#msg21438 is not the right one.
Title: Re: Another updated port to C of GDI+
Post by: JohnF on May 19, 2016, 07:12:53 AM
Attached.

John
Title: Re: Another updated port to C of GDI+
Post by: frankie on May 19, 2016, 09:31:53 AM
JJ It was my wrong. I forgot to add the include file.
I have update the download with the last version, that is slightly different from the older previous one supplied by John.
Thanks John anyway.
Title: Re: Another updated port to C of GDI+
Post by: JohnF on May 19, 2016, 09:45:20 AM
In your new download you have

#include <fGdiPlusFlat.h>

instead of

#include "fGdiPlusFlat.h"

John
Title: Re: Another updated port to C of GDI+
Post by: frankie on May 19, 2016, 11:20:03 AM
Yes because I have put the fGdiPlusFlat.h in "PellesC\include\win" to use it in more projects that I'm testing.
If the file works this should be the final location, to copy it in each project is not effective.
I'll update the download.
Title: Re: Another updated port to C of GDI+
Post by: JohnF on May 19, 2016, 08:01:20 PM
'if the file works'! Of course it'll work.  :)

John
 
Title: Re: Another updated port to C of GDI+
Post by: jj2007 on May 20, 2016, 04:05:15 AM
I have update the download with the last version, that is slightly different from the older previous one supplied by John.

Thanks to both of you.

Btw it chokes with main.c(33): fatal error #1035: Can't find include file <fGdiPlusFlat.h>, but that can be "healed" by using quotes instead of brackets:

#include "fGdiPlusFlat.h"

Apparently <file.h> searches the default include folder, while "file.h" searches in the current folder - see this SOF thread (http://stackoverflow.com/questions/21593/what-is-the-difference-between-include-filename-and-include-filename).
Title: Re: Another updated port to C of GDI+
Post by: frankie on May 20, 2016, 01:44:26 PM
Thanks John. I have updated the download, maybe you want add it to your site together with the old GDI+ sample.
JJ As I told to John in my former post I used <> because I have put my copy in the PellesC include directory. Anyway I updated the sample. Now is correct.
Title: Re: Another updated port to C of GDI+
Post by: JohnF on May 20, 2016, 02:02:05 PM
Yes, I will add it to my site.

EDIT: Ok, done.

John



Title: Re: Another updated port to C of GDI+
Post by: JohnF on May 22, 2016, 11:00:46 AM
So, to anyone doing GdiPlus demo(s) you are welcome to have it on my web site! :)

EDIT: Using Frankie's new header of course.

John


Title: Re: Another updated port to C of GDI+
Post by: frankie on May 26, 2016, 07:18:55 PM
attached you'll find the last version of fGdiPlusFlat.h with the first part of a paper on use of GDI+ under C and a test program.
The examples in the paper are coded in the example program.
Let me know your comments.
Title: Re: Another updated port to C of GDI+
Post by: JohnF on May 26, 2016, 08:06:03 PM
Good work, I look forward to "GDI+ Made flat - part 2.pdf" and maybe
GDI+ Made flat - part 3.pdf  :)

John
Title: Re: Another updated port to C of GDI+
Post by: jj2007 on May 27, 2016, 12:31:22 AM
So, to anyone doing GdiPlus demo(s) you are welcome to have it on my web site! :)

Try this one (http://masm32.com/board/index.php?topic=5076.msg54975#msg54975), John. Hint: It's not GfaBasic :)
Title: Re: Another updated port to C of GDI+
Post by: JohnF on May 27, 2016, 08:00:58 AM
So, to anyone doing GdiPlus demo(s) you are welcome to have it on my web site! :)

Try this one (http://masm32.com/board/index.php?topic=5076.msg54975#msg54975), John. Hint: It's not GfaBasic :)

The image looks good however it would have to be written in PellesC - use Frankies new header and most importantly one needs to be able to unzip the file, which I can't do.

John
Title: Re: Another updated port to C of GDI+
Post by: jj2007 on May 27, 2016, 02:10:19 PM
one needs to be able to unzip the file, which I can't do.

Oops, sorry 8) - source & exe added (http://masm32.com/board/index.php?topic=5076.msg54975#msg54975), for your inspiration (the *.asc opens in WordPad). Translating to Pelles C shouldn't be difficult for the expert, it's just under 70 lines, but for me it's too difficult.
Title: Re: Another updated port to C of GDI+
Post by: JohnF on May 27, 2016, 02:29:05 PM
one needs to be able to unzip the file, which I can't do.

Oops, sorry 8) - source & exe added (http://masm32.com/board/index.php?topic=5076.msg54975#msg54975), for your inspiration (the *.asc opens in WordPad). Translating to Pelles C shouldn't be difficult for the expert, it's just under 70 lines, but for me it's too difficult.

AVG says the EXE has a virus, the .asc file looks horrendous!

Who will translate into PellesC - not me.

John

Title: Re: Another updated port to C of GDI+
Post by: jj2007 on May 27, 2016, 03:30:33 PM
AVG says the EXE has a virus

Yeah, that's a serious problem (https://virusscan.jotti.org/en-US/filescanjob/us4a0n4m5s) 8)
Title: Re: Another updated port to C of GDI+
Post by: JohnF on May 27, 2016, 07:30:35 PM
Try this one (http://masm32.com/board/index.php?topic=5076.msg54975#msg54975), John. Hint: It's not GfaBasic :)

Jochen,

Have you a problem with GfaBasic? That's the second time you've mentioned it.

John
Title: Re: Another updated port to C of GDI+
Post by: jj2007 on May 28, 2016, 01:59:57 AM
No, on the contrary. Gfa was a modern language at its time, inspired by C and Pascal, and I used it a lot until a few years ago (the "real" Gfa is 16-bit, difficult with 64-bit Windows). In fact, MasmBasic has stolen a lot of its syntax from Gfa, such as Recall (http://www.webalice.it/jj2006/MasmBasicQuickReference.htm#Mb1172).
Title: Re: Another updated port to C of GDI+
Post by: iwrbc on August 28, 2020, 04:02:10 PM
Can it be that fgdiplusflat.h is not included in version 10? Or did I miss something? I now downloaded it from this post and it works, so not a bug deal, just wondering.
Thnx
Title: Re: Another updated port to C of GDI+
Post by: frankie on August 28, 2020, 09:25:53 PM
Can it be that fgdiplusflat.h is not included in version 10? Or did I miss something? I now downloaded it from this post and it works, so not a bug deal, just wondering.
Thnx
fgdiplusflat.h isn't part of the standard PellesC SDK.
It is part of my fSDK, available on PellesC forum (https://forum.pellesc.de/index.php?topic=7017.msg26620#msg26620) or directly from GitHub (https://github.com/Frankie-PellesC/fSDK) ;).
And... yes I haven't updated it from more than one year  :-[. I'll do it for PellesC 10 (because there is an annoying warning due to change of version.  :(
Title: Re: Another updated port to C of GDI+
Post by: iwrbc on August 28, 2020, 10:57:02 PM
Thnx for letting me know. I found the header file somewhere here in this forum and so far it works fine. Thanks for your contribution,
Title: Re: Another updated port to C of GDI+
Post by: John Z on August 30, 2020, 12:18:01 PM
:-[. I'll do it for PellesC 10 (because there is an annoying warning due to change of version.  :(

Interesting I've used it under V10 and did not see any version warning. I'll check again.


John Z
Title: Re: Another updated port to C of GDI+
Post by: frankie on August 30, 2020, 11:41:17 PM
:-[. I'll do it for PellesC 10 (because there is an annoying warning due to change of version.  :(

Interesting I've used it under V10 and did not see any version warning. I'll check again.


John Z

Maybe my beta version????  :o
I made some changes never published. I have to check ???
I'm so busy, and this work require full attention and commitment that's why I decided to pause it for a while...