Print Page | Close Window

How to use CXTPOffice2007Image::GetBitmapPixel

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=16176
Printed Date: 01 May 2025 at 2:22am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to use CXTPOffice2007Image::GetBitmapPixel
Posted By: rdhd
Subject: How to use CXTPOffice2007Image::GetBitmapPixel
Date Posted: 11 February 2010 at 4:40pm
I want to draw a background gradient that matches the colors of a ribbon bar group. But I don't know how to call GetBitmapPixel. I am trying to call GetBitmapPixel with the correct "point" coordinates. I can draw the image calling like this:
 
pImage->DrawImage(pDC, rcClient, pImage->GetSource(0,2), CRect(0,0,0,0));
 
and I see what appears to be the image I see when the ribbon draws a non-highlighted group (background). I cannot seem to find the correct offset point to pass GetBitmapPixel.
 
It also appears that the pixel returned is not in RGB format but rather is in BGR (I can only come close to the colors I see when I draw the image if I swap the red and green when calling the GDI GradientFill API.)
 
Can I call GetBitmapPixel to get the values I need? If not, how can I get the colors of the two "inner bands" that I see a group image contains.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net