Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How can I do transparent images?

Posted on 1998-12-19
1
Medium Priority
?
211 Views
Last Modified: 2010-04-16
I want to draw my image half-transparent on the background. How is it possible?
0
Comment
Question by:mitya83
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
jack_p50 earned 0 total points
ID: 1216615
It's simple, do this thing
for each pixel of your image :
get it's color number, background's color number, then calculate such
(transparency - real 0.0 - opaque to 1.0 - full transparent)
transr:=pal[colimage].r*transparency+pal[colbackgr].r*(1-transparency)
same for transg and transb
then calculate coltodraw:=closest_rgb(transr,transg,transb)
you must do closest_rgb yourself (see color with minimal (r-rneeded)^2+(g-gneeded)^2+(b-bneeded)^2 - thats best matching color)
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
This week I attended a Startup Week Chattanooga talk on Gender Diversity in Technology. Check out what I learned.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question