Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 319651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:40:51+00:00 2026-05-12T08:40:51+00:00

I am trying to draw a transparent (alpha) PNG image using CxImage, but it

  • 0

I am trying to draw a transparent (alpha) PNG image using CxImage, but it seems I’m missing some obvious step… The code so far is:

CxImage image(m_pImage, m_lSize, CXIMAGE_FORMAT_UNKNOWN);

CRect rcOut = rc;
rcOut.left = (rc.Width()/2) - (image.GetWidth()/2);
rcOut.right = rcOut.left + image.GetWidth();
rcOut.top = (rc.Height()/2) - (image.GetHeight()/2);
rcOut.bottom = rcOut.top + image.GetHeight();

image.Draw(dc.GetSafeHdc(),rcOut);

where m_pImage is loaded elsewhere using:

CxImage image(strPath,CXIMAGE_FORMAT_UNKNOWN);
long lSize = 0;
BYTE * pBuf = NULL;

RGBQUAD rgbq;
rgbq.rgbRed = 255;
rgbq.rgbGreen = 255;
rgbq.rgbBlue = 255;
rgbq.rgbReserved = 0;

image.Thumbnail(paramImageSize, paramImageSize, rgbq);
image.SetJpegQuality(100);
image.Encode(pBuf, lSize, CXIMAGE_FORMAT_JPG);

Can you see what I’m missing?

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T08:40:52+00:00Added an answer on May 12, 2026 at 8:40 am

    It seems that the Thumbnail() function caused those problem along with the destination format being JPEG. Changed to Resample2() and PNG and it’s ok.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to draw a transparent.png image over a TV signal (so blending before
I'm trying to draw semi-transparent primitives (lines, circles) in OpenGL ES using Cocos2d but
I'm trying to draw a semi-transparent rectangle on top of an image to act
I am trying to export transparent PNG files using this class: com.adobe.images.PNGEncoder; var pngSource:BitmapData
I'm trying to draw grayscale image in color as texture in OpenGL using two
I am trying to draw a transparent plane (X[0..100],Y[0..100],Z=0) in Java 3D, but can't
I'm trying to draw a transparent object inside an opaque cage, but what ever
I am trying to draw/print a text, but i need a transparent background. I
I'm trying to render some transparent objects using: glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); However, I don't get
I'm trying to draw an image, with a source Bitmap and an alpha mask

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.