Click here to Skip to main content
13,766,627 members

Windows API

 
QuestionAnimate GIF in C Pin
luplup15-Jan-18 23:49
memberluplup15-Jan-18 23:49 
Hello,
I dont find any way to play the animation of a loaded GIF file in C, not C++.
Is it possible ??

I tried using GDI+ with the gdiplusflat.h and i aborded with the error "unknown type: Graphics, Image, or Pen" when compiling.
Tried too with the types GpGraphics, GpImage, or GpPen and then i get an error on Color() and dont find what was the problem...
Yes, maybe i dont need Color() or Pen, but it was for testing if GDI+ was really there.
GdiplusStartupInput and GdiplusStartup() seem working.

Next, after many test/search, i found this, a C code for displaying GIF image :
https://www.codeproject.com/Articles/3283/Library-to-display-an-image-JPG-GIF-BMP-in-lin
JPG and BMP are ok, but GIF dont play the frames and looks to have no alpha.
So, is there a way to do this with the OLE !?
Or any other way that dont need switching to C++

I'm with CodeBlock IDE (MinGW and GCC) using the Win32 GUI.
Please help me! im a good rookie who begin in C Smile | :)


Retry edit:
-----------
So i retry GDI+ and "pass" the error Color() with Color(Blue) and now it's DrawLine() error: undefined reference to pen...

C++ good code:
Graphics graphics(HDC hdc);
Pen pen(Color(255, 0, 0, 255));
graphics.DrawLine(&pen, 0, 0, 200, 100);


C bad code:
GpGraphics graphics(HDC hdc);
GpPen pen(Color(Blue));
GdipDrawLine(&graphics, &pen, 0, 0, 200, 100);


Have tried without success some: GpPen myPen = pen(Color(Blue));
Ok i resign C/GDI+ without help, and i dont know if GpX/GdipX is the right way..
The msdn docs say "Windows GDI+ is a class-based API for C/C++ programmers" but i dont find anybody that have implemented it in C.

Tried GDI+ with C++ project and get it working directly.. damn...
I hope there is something for C
Please HELP !

modified 16-Jan-18 5:10am.

AnswerRe: Animate GIF in C Pin
Jochen Arndt16-Jan-18 0:40
mvpJochen Arndt16-Jan-18 0:40 
GeneralRe: Animate GIF in C Pin
luplup16-Jan-18 12:14
memberluplup16-Jan-18 12:14 
GeneralRe: Animate GIF in C Pin
Jochen Arndt16-Jan-18 13:05
mvpJochen Arndt16-Jan-18 13:05 
NewsRe: GDI+ in C Pin
luplup18-Jan-18 1:49
memberluplup18-Jan-18 1:49 
GeneralRe: GDI+ in C Pin
Jochen Arndt18-Jan-18 2:29
mvpJochen Arndt18-Jan-18 2:29 
AnswerRe: GDI+ in C Pin
luplup19-Jan-18 3:29
memberluplup19-Jan-18 3:29 
GeneralRe: GDI+ in C Pin
Jochen Arndt19-Jan-18 4:14
mvpJochen Arndt19-Jan-18 4:14 
GeneralRe: GDI+ in C Pin
luplup19-Jan-18 5:59
memberluplup19-Jan-18 5:59 
GeneralRe: GDI+ in C Pin
Richard MacCutchan19-Jan-18 6:35
protectorRichard MacCutchan19-Jan-18 6:35 
GeneralRe: GDI+ in C Pin
Jochen Arndt19-Jan-18 6:48
mvpJochen Arndt19-Jan-18 6:48 
GeneralRe: GDI+ in C Pin
Richard MacCutchan19-Jan-18 7:28
protectorRichard MacCutchan19-Jan-18 7:28 
GeneralRe: GDI+ in C Pin
Richard MacCutchan18-Jan-18 2:48
protectorRichard MacCutchan18-Jan-18 2:48 
GeneralRe: GDI in C Pin
luplup19-Jan-18 3:42
memberluplup19-Jan-18 3:42 
GeneralRe: GDI in C Pin
Richard MacCutchan19-Jan-18 3:58
protectorRichard MacCutchan19-Jan-18 3:58 
QuestionWrite plugin for Windows in JAVA Pin
Member 1327352322-Jun-17 2:56
memberMember 1327352322-Jun-17 2:56 
AnswerRe: Write plugin for Windows in JAVA Pin
Richard MacCutchan22-Jun-17 22:21
protectorRichard MacCutchan22-Jun-17 22:21 
QuestionHow to overcome legal disclaimer message on RDP Session Pin
akil_raj12-May-17 2:14
memberakil_raj12-May-17 2:14 
AnswerRe: How to overcome legal disclaimer message on RDP Session Pin
Pete O'Hanlon12-May-17 3:53
protectorPete O'Hanlon12-May-17 3:53 
AnswerRe: How to overcome legal disclaimer message on RDP Session Pin
Gerry Schmitz12-May-17 9:48
memberGerry Schmitz12-May-17 9:48 
QuestionWin32 API with c Pin
Kebedeaka3-Feb-17 18:24
memberKebedeaka3-Feb-17 18:24 
AnswerRe: Win32 API with c Pin
Richard MacCutchan3-Feb-17 23:15
protectorRichard MacCutchan3-Feb-17 23:15 
AnswerRe: Win32 API with c Pin
ZurdoDev6-Apr-17 3:12
professionalZurdoDev6-Apr-17 3:12 
Questionwin 32 api with c Pin
Kebedeaka1-Feb-17 18:15
memberKebedeaka1-Feb-17 18:15 
AnswerRe: win 32 api with c Pin
Afzaal Ahmad Zeeshan1-Feb-17 23:44
mvpAfzaal Ahmad Zeeshan1-Feb-17 23:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web01-2016 | 2.8.181114.1 | Last Updated 10 Feb 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid