Click here to Skip to main content
15,892,809 members
Home / Discussions / Graphics
   

Graphics

 
QuestionWebcam Pin
genna9926-Jun-07 10:42
genna9926-Jun-07 10:42 
QuestionOpenGL, DirectX, WPF ?? Pin
BusyDeveloper21-Jun-07 21:55
BusyDeveloper21-Jun-07 21:55 
AnswerRe: OpenGL, DirectX, WPF ?? Pin
El Corazon26-Jun-07 5:47
El Corazon26-Jun-07 5:47 
QuestionZooming the line in OpenGL Pin
a_david12320-Jun-07 23:19
a_david12320-Jun-07 23:19 
QuestionHow to AddAlpha Values ?? Pin
SandipG 20-Jun-07 18:22
SandipG 20-Jun-07 18:22 
QuestionRe: How to AddAlpha Values ?? Pin
Mark Salsbery21-Jun-07 6:59
Mark Salsbery21-Jun-07 6:59 
AnswerRe: How to AddAlpha Values ?? Pin
SandipG 21-Jun-07 18:22
SandipG 21-Jun-07 18:22 
GeneralRe: How to AddAlpha Values ?? Pin
Mark Salsbery22-Jun-07 5:37
Mark Salsbery22-Jun-07 5:37 
Gotcha.

Since there's only two compositing modes, you may have to loop through and combine the alpha
values the way you want to.

SandipG wrote:
now i want to replace 255 with other values or Replace 0's with values from first column.


CompositingModeSourceOver works for the "Replace 0's with values from first column" case but not
for the "replace 255 with other values" case.

Here's some code you can play with to see the compositing results...
// Create a 20x20 ARGB bitmap
Gdiplus::Bitmap Bitmap1(20, 20, PixelFormat32bppARGB);
 
Gdiplus::Rect rect(0, 0, 20, 20);
 
// Create a Graphics object from the bitmap
Gdiplus::Graphics *pBitmapGraphics1 = Gdiplus::Graphics::FromImage(&Bitmap1);
 
// Try different compositing modes
//pBitmapGraphics1->SetCompositingMode(Gdiplus::CompositingModeSourceCopy);
pBitmapGraphics1->SetCompositingMode(Gdiplus::CompositingModeSourceOver);
 
// Try different colors to blend - brush is background, pen is foreground
Gdiplus::SolidBrush solidbrush(Gdiplus::Color(0xFF,0x00,0xFF,0x00));//Gdiplus::Color::Transparent);
Gdiplus::Pen solidpen(Gdiplus::Color(0x40,0xFF,0x00,0x00), 1.0);//Gdiplus::Color::Transparent, 1.0);
 
// Fill the background with the brush color and draw the first row with the pen, using
// the current compositing mode
pBitmapGraphics1->FillRectangle(&solidbrush, rect);
pBitmapGraphics1->DrawLine(&solidpen, 0, 0, 19, 0);
 
// Release the bitmap from the graphics object so we can look at the pixel bits
delete pBitmapGraphics1;
pBitmapGraphics1 = 0;
 
// Look at the pixel bits (look at pRGBQuads in a debugger memory window)
Gdiplus::BitmapData bitmapData;
Bitmap1.LockBits(&rect,	ImageLockModeRead, PixelFormat32bppARGB, &bitmapData);
RGBQUAD *pRGBQuads = (RGBQUAD *)bitmapData.Scan0;
Bitmap1.UnlockBits(&bitmapData); //<code><-- put breakpoint here</code>





"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

GeneralRe: How to AddAlpha Values ?? Pin
SandipG 24-Jun-07 19:47
SandipG 24-Jun-07 19:47 
GeneralRe: How to AddAlpha Values ?? [modified] Pin
Mark Salsbery25-Jun-07 6:28
Mark Salsbery25-Jun-07 6:28 
QuestionImage Warp Function needed. Pin
SandipG 20-Jun-07 2:02
SandipG 20-Jun-07 2:02 
AnswerRe: Image Warp Function needed. Pin
Force Code20-Jun-07 6:39
Force Code20-Jun-07 6:39 
GeneralRe: Image Warp Function needed. Pin
SandipG 20-Jun-07 18:09
SandipG 20-Jun-07 18:09 
QuestionIntelligent Connectors Pin
whatitis17-Jun-07 19:12
whatitis17-Jun-07 19:12 
AnswerRe: Intelligent Connectors Pin
Tim Craig18-Jun-07 18:16
Tim Craig18-Jun-07 18:16 
GeneralRe: Intelligent Connectors Pin
whatitis18-Jun-07 18:39
whatitis18-Jun-07 18:39 
QuestionIntelligent Connectors Pin
whatitis17-Jun-07 19:12
whatitis17-Jun-07 19:12 
QuestionIDirectDrawSurface7::Blt function does not work with secondary screen [modified] Pin
raytracingx17-Jun-07 16:36
raytracingx17-Jun-07 16:36 
QuestionGDI+ How to limit number of PathPoints in GraphicsPath [modified] Pin
shipstech15-Jun-07 7:49
shipstech15-Jun-07 7:49 
QuestionInner and Outer Bevel Effects. Pin
Sameerkumar Namdeo14-Jun-07 23:38
Sameerkumar Namdeo14-Jun-07 23:38 
QuestionAnti-Aliasing routine needed Pin
Force Code14-Jun-07 13:39
Force Code14-Jun-07 13:39 
AnswerRe: Anti-Aliasing routine needed Pin
Christian Graus14-Jun-07 14:09
protectorChristian Graus14-Jun-07 14:09 
GeneralRe: Anti-Aliasing routine needed Pin
Force Code14-Jun-07 14:30
Force Code14-Jun-07 14:30 
GeneralRe: Anti-Aliasing routine needed Pin
Christian Graus14-Jun-07 18:05
protectorChristian Graus14-Jun-07 18:05 
GeneralRe: Anti-Aliasing routine needed Pin
Force Code15-Jun-07 1:52
Force Code15-Jun-07 1:52 

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.