News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Bitmap

Started by Hunk, March 07, 2012, 03:54:49 AM

Previous topic - Next topic

Hunk

Hi,

I got a bitmap image and I want to remove the white portion outside the bitmap and want to make it transparent.  Can anyone provide me some example or idea how to do so? :U

dedndave

i use an icon editor - then save as a bmp, png, or gif
can you attach the image ?

Hunk

I attached jpg format. I hope you have no issue with it.  The main problem is white portion, but I want only image not that white portion around it.  While selecting image in winasm I only get bitmap option, not for png and gif formats...

dedndave

jpg's are lossy and hard to make transparencies from
but - that image is a png and is already a transparency   :bg


dedndave

notice the red circles

open the image to paste to (target) in one instance of Paint
open the transparency in another instance of Paint

in both instances, select a black background (circles at bottom)

in the instance that has the transpareny, click Edit - Select All
then Edit - Copy
on the left, click on the transparency mode icon (circle on left)

in the target instance, click Edit - Paste
on the left, click on the transparency mode icon (circle on left)

move the transparency around until you have it where you like and save the file   :U

click on the image below for full size

qWord

If you want to show some parts of the images, you can create a control and set the window region according to the image data (see my first and third post)
FPU in a trice: SmplMath
It's that simple!

dedndave

i just noticed that the image has shading below the ball   :P
this is done with varying levels of transparency - a dib version 5 thing, i think
i would like to know if the Paint program for win 7 handles it correctly - i am using XP

fearless

pbrush for windows 7 allows transparent selection, but the dithered part at bottom of globe doesnt seem to show right, has a white halo type effect on it.
ƒearless

qWord

For Windows Vista or newer,  an alpha channel can be easily added to a window using the DwmEnableBlurBehindWindow function.
Eaxmple Attached.
FPU in a trice: SmplMath
It's that simple!

dedndave

hmmmmm
have to write one for XP   :P

must be in there, already
when i posted the image, it renders correctly in FireFox

hfheatherfox07

Quote from: dedndave on March 07, 2012, 08:21:46 PM
hmmmmm
have to write one for XP   :P

must be in there, already
when i posted the image, it renders correctly in FireFox


I found this http://code.google.com/p/max2aero/source/browse/?r=172#svn%2Ftrunk%2FDwmApi%253Fstate%253Dclosed

could the dwmapi.lib and dwmapi.def be used to make  dwmapi.inc so we can use this technique on windows XP ?
if anything I found AeroStyle.xml ... I remember some one looking for that ...but for got who

hfheatherfox07

Is this something similar that I was trying to achieve here   http://www.masm32.com/board/index.php?topic=17505.0

To answer your original question Hunk ... try GIMP Portable... It is free and not pirated (even source available)  http://portableapps.com/apps/graphics_pictures/gimp_portable

under image options you could remove alpha blend ...or under edit remove all background ... I messed with .png's last night

dedndave

well - having the def file doesn't help
as qWord stated, Dwm is vista or newer