Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Bitmaps in menu

Posted on 2007-04-10
8
Medium Priority
?
186 Views
Last Modified: 2010-04-05
I'm building a program from Windows API only in delphi and I am needing to create a popupmenu with images in it. I need help drawing the images in rows of 4 or 5 and the background color should be transparent. The bitmaps mask is what delphi considers the clFuchsia color which looks purple like many other Windows bitmaps. Any help with this? I would prefer the menu to not use the graphics unit or menus unit so what i am meaning is no VCL just windows API. I'm failing to make the bitmaps bgcolor transparent so this is what I am here.

TIA,
Shaguard
0
Comment
Question by:shaguard
[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
  • 4
  • 4
8 Comments
 
LVL 9

Expert Comment

by:arioh
ID: 18887161
How you loading bitmaps?
0
 

Author Comment

by:shaguard
ID: 18887177
LoadBitmap() from a compiled resource, 1 at a time.
0
 
LVL 9

Expert Comment

by:arioh
ID: 18887220
try to use LoadImage() with LR_LOADTRANSPARENT flag
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:shaguard
ID: 18887849
It makes it work mostly but I still notice that there's some minor trim around the image and when you select over each image it draws a new color over the menu items, is there any way to stop that? Something like SetBkColor for menus so that the new menu items always match the background color of the popupmenu?

TIA,
Shaguard
0
 
LVL 9

Accepted Solution

by:
arioh earned 2000 total points
ID: 18888096
try LR_LOADTRANSPARENT + LR_CREATEDIBSECTION
if no success - maybe you can post a code?
0
 

Author Comment

by:shaguard
ID: 18896363
I've tried virtually all possible flags with LoadImage and it's the same result which is the image background is not the correct color of COLOR_WINDOW I guess is what it would be for transparent. I believe I am in need of having to do grunt work myself with actual bitmap image and setup mask and handle raw HDC to get the result I need. Do you have any experience with TransparentBlt because I have seen some example codes do this?

TIA,
Shaguard
0
 
LVL 9

Expert Comment

by:arioh
ID: 18896947
sorry, no experience yet :)
0
 

Author Comment

by:shaguard
ID: 18904090
Thanks much arioh, I have accepted your answer since it does do what I originally asked.

Shaguard
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

688 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