Convert RGBA to bmp format
Convert RGBA to bmp format
Can I get help in converting RGBA image to Bitmap?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert RGBA to bmp format
Yes, you can.
Some more detail might help us to help you.
Some more detail might help us to help you.
snibgo's IM pages: im.snibgo.com
Re: Convert RGBA to bmp format
Please find below my code:
#include <Magick++.h>
#include <iostream>
#include <fstream>
#include <stdio.h>
#include "stdafx.h"
using namespace std;
using namespace Magick;
//#pragma warning(disable : 4996)
int main(int argc,char **argv)
{
InitializeMagick(*argv);
return 0;
}
When I build I get below error:
error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl Magick::InitializeMagick(char const *)" (__imp_?InitializeMagick@Magick@@YAXPBD@Z) referenced in function _main
I have done below declarations in Project settings:
C\C++ -> General -> Addtn Include Directories -> ImageMagick-7.0.4-Q16\include
Linker-> General->Addtn Library Directories -> ImageMagick-7.0.4-Q16\lib
#include <Magick++.h>
#include <iostream>
#include <fstream>
#include <stdio.h>
#include "stdafx.h"
using namespace std;
using namespace Magick;
//#pragma warning(disable : 4996)
int main(int argc,char **argv)
{
InitializeMagick(*argv);
return 0;
}
When I build I get below error:
error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl Magick::InitializeMagick(char const *)" (__imp_?InitializeMagick@Magick@@YAXPBD@Z) referenced in function _main
I have done below declarations in Project settings:
C\C++ -> General -> Addtn Include Directories -> ImageMagick-7.0.4-Q16\include
Linker-> General->Addtn Library Directories -> ImageMagick-7.0.4-Q16\lib
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert RGBA to bmp format
Okay, so you have a linker error when building your program. What toolchain are you using? I use Gnu C, part of Cygwin, and have no problems. I probably can't help, but perhaps you can say what toolchain you use (and search for that on these forums).
snibgo's IM pages: im.snibgo.com
Re: Convert RGBA to bmp format
I use below platform toolset:
Visual Studio 2012 (v110)
Also, can you tell me what commands should I use to convert rgba files to bmp?
Visual Studio 2012 (v110)
Also, can you tell me what commands should I use to convert rgba files to bmp?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert RGBA to bmp format
If your RGBA files are literally that, with no header, just pixels, something like this:
... but with the correct size.
Code: Select all
convert -size 123x456 RGBA:in.bin out.bmp
snibgo's IM pages: im.snibgo.com
Re: Convert RGBA to bmp format
I would be writing it in C++ so let me know what functions should I call?
I searched on the net and found below snippet:
Magick::Blob blob(data, length);
Magick::Image image;
image.size("640x480")
image.magick("RGBA");
image.read(blob);
image.write("file.bmp");
Is this correct?
I searched on the net and found below snippet:
Magick::Blob blob(data, length);
Magick::Image image;
image.size("640x480")
image.magick("RGBA");
image.read(blob);
image.write("file.bmp");
Is this correct?