Click here to Skip to main content
15,891,033 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSoftware Keyboard Simulator Pin
RedDragon2k15-Jan-11 4:48
RedDragon2k15-Jan-11 4:48 
AnswerRe: Software Keyboard Simulator Pin
jschell15-Jan-11 10:02
jschell15-Jan-11 10:02 
AnswerRe: Software Keyboard Simulator Pin
Andrew Brock15-Jan-11 17:16
Andrew Brock15-Jan-11 17:16 
AnswerRe: Software Keyboard Simulator Pin
loyal ginger15-Jan-11 17:25
loyal ginger15-Jan-11 17:25 
GeneralRe: Software Keyboard Simulator Pin
RedDragon2k16-Jan-11 4:11
RedDragon2k16-Jan-11 4:11 
QuestionHow to Set Position where a Window will be minimised Pin
SoftwareDeveloperGoa15-Jan-11 4:42
SoftwareDeveloperGoa15-Jan-11 4:42 
AnswerRe: How to Set Position where a Window will be minimised Pin
Emilio Garavaglia15-Jan-11 7:09
Emilio Garavaglia15-Jan-11 7:09 
GeneralRe: How to Set Position where a Window will be minimised Pin
SoftwareDeveloperGoa15-Jan-11 7:17
SoftwareDeveloperGoa15-Jan-11 7:17 
GeneralRe: How to Set Position where a Window will be minimised Pin
Emilio Garavaglia15-Jan-11 8:52
Emilio Garavaglia15-Jan-11 8:52 
GeneralRe: How to Set Position where a Window will be minimised Pin
SoftwareDeveloperGoa15-Jan-11 9:01
SoftwareDeveloperGoa15-Jan-11 9:01 
QuestionWhat wrong with this loop? Pin
Le@rner14-Jan-11 19:34
Le@rner14-Jan-11 19:34 
AnswerRe: What wrong with this loop? Pin
Andrew Brock14-Jan-11 21:10
Andrew Brock14-Jan-11 21:10 
AnswerRe: What wrong with this loop? Pin
jixuduxing14-Jan-11 22:37
jixuduxing14-Jan-11 22:37 
GeneralRe: What wrong with this loop? Pin
Andrew Brock14-Jan-11 23:39
Andrew Brock14-Jan-11 23:39 
AnswerRe: What wrong with this loop? Pin
cp987614-Jan-11 23:49
cp987614-Jan-11 23:49 
AnswerRe: What wrong with this loop? Pin
Richard MacCutchan15-Jan-11 0:02
mveRichard MacCutchan15-Jan-11 0:02 
AnswerRe: What wrong with this loop? Pin
CPallini15-Jan-11 2:39
mveCPallini15-Jan-11 2:39 
AnswerRe: What wrong with this loop? Pin
yu-jian15-Jan-11 3:43
yu-jian15-Jan-11 3:43 
Question(OpenGL/MFC/Win32) glReadPixels and CreateBitmap question... Pin
Maximilien14-Jan-11 7:57
Maximilien14-Jan-11 7:57 
AnswerRe: (OpenGL/MFC/Win32) glReadPixels and CreateBitmap question... Pin
User 742933814-Jan-11 10:03
professionalUser 742933814-Jan-11 10:03 
QuestionString Problem Pin
john563214-Jan-11 1:22
john563214-Jan-11 1:22 
AnswerRe: String Problem Pin
Stephen Hewitt14-Jan-11 1:34
Stephen Hewitt14-Jan-11 1:34 
AnswerRe: String Problem Pin
Maximilien14-Jan-11 1:59
Maximilien14-Jan-11 1:59 
Questioncreate dimmed icon with magick++ (ImageMagick) Pin
Thue Andersen13-Jan-11 22:10
Thue Andersen13-Jan-11 22:10 
I’m trying to use ImageMagick for what I believed would be a simple task.
I want to generate a dimmed version of an image/icon at runtime in the application.
I use the magick++ c plus api.

I have found some commands that give me an ok result when run from the command line.
Converting the commands to the c++ api was a bit challenging, and the result is then not as hoped.

// Command example
convert -size 32x32 xc:"#999999" gray32.png
composite -dissolve 50% logo32.png gray32.png dim_logo32.png


How would this look in c++?
I came up with this.
Magick::Image gray;
gray.size( Magick::Geometry(image.columns(), image.rows()));
gray.read( "xc:#999999");
gray.label( "gray" );

if(gray.isValid()) {
gray.opacity(QuantumRange/2);
image.composite(gray, Magick::Geometry(image.columns(),image.rows()), Magick::DissolveCompositeOp );


But the transparency in the picture is lost.


A other suggestion as to make a dimmed image, is to make the full image semi transparent.

convert input.png -channel Alpha -evaluate Set 50% output.png

This could work. The transparency is kept when I tried this from command line.
Changing this to c++ api confused me a lot.

I ended up with this single line.

image.opacity(QuantumRange/ 2);

Now the result from this confuses me. The image is semi transparent, but the background that was originally transparent is now magenta.
orginal icon


dimmed icon

AnswerRe: create dimmed icon with magick++ (ImageMagick) Pin
Chris Losinger14-Jan-11 3:04
professionalChris Losinger14-Jan-11 3:04 

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.