473,385 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Is there a "Transparent Color" for images?

675 512MB
I want to put my own icon on a form. For discussion purposes, lets say that I want a very large "option button" from my collection of personal images.

Of course, there are 2 images, imgOptButtTrue and imgOptButtFalse. I would like these to go on any form, any color.

As images are rectangular in shape, I need to fill the area outside the circle with some color that allows the background color show through. Either that, or I need to be able to change these same pixels to a certain color on form load.

This is possible for cursors developed in Visual Basic, which I do not own. Can it be done for Access. Attempts to create an image by changing .cur to some other extension hasn't worked. Assigning an image with the extension .cur accepts the assignment, but does not display the image.

OldBirdman
Dec 28 '07 #1
21 20526
Minion
108 Expert 100+
When doing some searching I found this thread from some time ago on the board. (http://www.thescripts.com/forum/thread441620.html) It mentions needing to do some other things with transparent images, but it does link to a site with a DB that was built to convert images to EMF files that seem to work.

Hope this helps.

- Minion -
Dec 28 '07 #2
OldBirdman
675 512MB
I followed the 7 step program in the link suggested. My image has a white background, so it should work. However, setting back style to transparent did not change the white to transparent. I have a black-and-white, rectangular, image on my form.

I don't have anything to manipulate images other than Paint, and therefore the pixel color for white may not be the same white as needed for transparency.

Do I need another program for generating my own icons/images, or is there a way in Paint to assure the correct white?

OldBirdman
Dec 28 '07 #3
jaxjagfan
254 Expert 100+
The background color is the color of the image control background (the container the image is in) - not the image itself. If you want to make the background of the image itself tranparent then try Paint Shop Pro (I use Photoshop and Fireworks but both are a bit more expensive than PSP.) The image would need to be saved in a GIF or PNG format - JPG and BMP will not save the transparency info to the image file.
Dec 28 '07 #4
OldBirdman
675 512MB
So the answer is NO! It cannot be done within the Microsoft environment. I need expensive programs to impliment.

Thanks to both of you.

OldBirdman
Dec 28 '07 #5
jaxjagfan
254 Expert 100+
So the answer is NO! It cannot be done within the Microsoft environment. I need expensive programs to impliment.

Thanks to both of you.

OldBirdman
No expensive tools required. Go to zdnet.com or download.com (and others). The are free and trial versions of software that you can use to create transparent images.

It takes a lot of work to get an Access form to look Professional and not look like ACCESS. You can spend more time on the user interface than coding its functionality if you get picky. Get your application to function first then go back and do the "pretty" stuff.
Dec 28 '07 #6
OldBirdman
675 512MB
I am trying to sell my ideas to a local retail chain, and "Pretty" is more important than Access practable. At this time I need pretty.

OldBirdman
Dec 28 '07 #7
OldBirdman
675 512MB
I have spent an entire day (12/29/07) investigating programs that claim to give transparency. Maybe they do in the Windows/Desktop environment, but not in Access. I want transparency in Access.

For purposes of this discussion, I'm going to, for the moment, work in the Microsoft environment. Access, Paint, etc.

I want to create my own pictures for command buttons. ALL Buttons in Access are gray (grey in Anglo-Saxon???). But what color gray? I don't know how to transfer a 24 bit number in Access into a color in Paint. The default "Gray" is not the same in both programs, and the "Pick" ("Pik") tool does not allow me to go outside the image I am editing.

I downloaded 7 different paint programs. None allowed Pick outside the image being edited. Every shade of gray I try is too pink. I used their transparent color, but Access doesn't recognize this.

Is there any way to develop a "Library" of icons for either buttons, or on the form, that allows the background color to show. i.e. I want a black "Not", a circle with a diagonal line thru it, on any form, any color. Possible?

OldBirdman
P.S. "Get your application to function first then go back and do the 'pretty' stuff". Who said my application doesn't function? Even if it doesn't, this question will come up when it does. I want all answers I will need, even if not presented to this forum in serial order.
Dec 30 '07 #8
FishVal
2,653 Expert 2GB
Hi, OldBirdman.

Take a look at the attached Icon file created in open-source graphical editor GIMP 2.

Regards,
Fish
Attached Files
File Type: zip (No).zip (418 Bytes, 628 views)
Dec 30 '07 #9
OldBirdman
675 512MB
The attached icon has a background color equal to (or close to) the default button color of MSAccess. For that, I agree.

If I try to use it as an image on the form, which is not gray, the gray background contrasts with the form color.

Let us say I want a Large, Purple Arrow pointing to the control (TextBox) that has the error. Let us also say that the form color was a user option, and so I don't know what it is. I do know where the control is, and so I can locate the image with .top = top.txtboxZZZ - 1440 * .3 and .left = left.txtboxZZZ - 1440 * .4 . But I do not want a purple arrow in a gray field, I want a purple arrow surrounded by the background color of the form (or detail section if you are going to nit pik).

Cursors created in visual basic cursor editor have a transparent color, and this transparency applies to all windows applications. So really my question is - Does MSAccess support any color as transparent so I can put my standard purple arrow on any form or button?

OldBirdman
Jan 4 '08 #10
jaxjagfan
254 Expert 100+
The icon created by FishVal is transparent in an unbound object control. The default image control apparently will not work - i tried a few different image types. You may need to look into custom controls for this. I normally change forecolor or backcolor of the textbox or its label to highlight an error and disable navigation controls until error is resolved.
Jan 4 '08 #11
OldBirdman
675 512MB
Thank you jaxjagfan:

So beyond knowing that I can do what I asked, and why I can't do what I asked, what next?

This is the question to the forum, and the answers so far presented do not solve the problem, only tell me that the problem is solvable. There is a huge difference between solved and solvable.

I want to create a "library" of icons to place on a form. These should have a transparent backcolor, so they will go anywhere on any form.

I know that this is possible, from previous posts, but I guess I am missing something. I cannot do this. Why?

OldBirdman
Jan 5 '08 #12
FishVal
2,653 Expert 2GB
Hi, OldBirdman.

Access (particulary Image control) has problems with displaying transparent color. You may try to use pictures in vector format (.wmf or .cdr). That seems to work.
OLE unbound control seems to display transparent color properly but it couldn't be transparent itself. :(

Regards,
Fish
Jan 13 '08 #13
OldBirdman
675 512MB
You guys(gals) are great! I get usable answers to over 50% of my posts. For that I am extremely grateful.

This question is not going to be one of my success stories. Using my "Purple Arrow" of #10, I can create this in "Paint" with any background whatever. Except transparent. OK, I have this icon in my library, but it only works in one program with one background color.

In simple steps, can I convert this .ico file to .wmf or .cdr, or some other extension that supports transparency.

Notice in post #5, I wanted to quit this thread and use "No" for the answer. But the thread continues. "Go to zdnet.com or download.com (and others)", which I did, and could not find anything that would convert my icons to icons with transparent backgrounds. Posts beyond this I have looked at, downloaded samples, etc. but I cannot get these answers to fit my question.

I am stymied. I have a 2 color "Purple Arrow on Gray Background" icon. I need a step by step instruction to convert the Gray to transparent, or I need to close this thread.

OldBirdman
Jan 18 '08 #14
FishVal
2,653 Expert 2GB
Dear sir.

First and for most lets separate cutlet from flies.

Cutlet.
One can easily create an image with transparent background in a format supporting transparent color, btw the image I've attached to the thread previously has a transparent background.

Flies.
Access.Image control doesn't display transparent color properly and Access.ObjectFrame on the other hand displays transparent color properly but the control itself couldn't be transparent - bad luck.

The easiest workaround I see here is to use pictures in vector format: CDR (CorelDraw) or WMF/EMF (Windows Metafile). Access.Image control displays these formats with transparent background.

I'm attaching a simple WMF with purple arrow created in trial version of Companion metafile editor

Kindest regards,
Fish
Attached Files
File Type: zip parrow.zip (257 Bytes, 449 views)
Jan 18 '08 #15
OldBirdman
675 512MB
I tried your "Purple Arrow", and it does have a transparent background, and Access accepts it nicely in an image control.

I have downloaded the trial version of Companion metafile, and have been trying to create my own images. Can't do yet, but if I start with yours, I can do it.

Too bad wmf files won't also work on command buttons. Maybe I'll write my own button control and then I could have colored buttons, not gray. Shapes other than rectangular also. Might be fun.

Anyway, thank you for all your help.

OldBirdman
Jan 18 '08 #16
FishVal
2,653 Expert 2GB
You may use MSForms.CommandButton.
See the attached file.

P.S. The buttons in the attached file were edited in Excel and then copypasted to Access form.
Attached Files
File Type: zip MSForms.CommandButton.zip (12.1 KB, 524 views)
Jan 19 '08 #17
MCMLXI
1
Hi,
Just an idea, I find that rather than a transparent background cxreating an image file with an exactly matched bacground works 100%. Just find the RGB code of the Access background and with the graphic editor replace the image background with it. Gimp should be able to do this (I personally use Photopaint.
Good luck
Jan 20 '08 #18
OldBirdman
675 512MB
FishVal - I looked at your colored buttons, but I cannot do that. I purchased this computer with Office 2000-Professional pre-installed. I do not have a disk, and Excel says I need to insert the disk to get the feature. Tried my Office 98 disk, but didn't work. Very nice though.

Whenever I try to go beyond basic, native, Access, I seem to get into trouble. The libraries are not available, and I must re-establish them using References ... As I don't know how to figure out which ones I need, I get stymied. I have enough trouble just keeping the toolbars correct from session to session, or the form size to be consistant.

So for now, I'll just use gray buttons. The gif files don't work on buttons, so that idea is gone.

1961(Roman) - Post #1, paragraph 2 clearly states that I am not prepared to hold to a single color for each and every form I design/develop. Beyond that, I tried to build my own collection of button images. I have not located a picture edit program that will tell me the default color of Access buttons. The basic gray is not as pink as the Paint default gray. I do not have a picture editor that allows a pik beyond the window where the edit is preformed.

OldBirdman
Jan 22 '08 #19
viking
1
I found this thread looking for the same information as OldBirdman.
I wished to use Office toolbar bitmaps (or any other bitmap) as an Access (2003 in this case) button image. These are 16x16pixel images.

Here is my solution:
If you don't already have the bitmap file:
Copy the image you want to the clipboard - I used the toolbar customise utility to capture the desired toolbar button image to clipboard.
Open Paint and paste the image into a new window. You might want to set the image attributes to 16x16 beforehand.
Save the bitmap using whatever folder and name you want.

Then:
I then used a program called IcoFX - freeware, to import the bitmap into a new icon 'document' in IcoFX. Make sure to set the icon size to 16x16 (if that's what you want).
Then using IcoFX, clear the unwanted background colour, The transparent background "colour" is indicated by a gray and white checkerboard pattern in the colours dialog of IcoFX. Bring the checkboard "colour" to the foreground brush, then paint using fill or pen to replace the unwanted colour.

Save the icon to file. Use the Image/Data Type menu to select "24bits True colors" as the icon data type. 24bits with alpha channel doesn't work in Access 2003.

Close the file in IcoFX.

Return to Access and go to the button properties - select the button picture property and browse to your new ico file. Select Icons (*.ico) as the file format in the "files of type" selection at the bottom of the file dialog. The new icon should load and display in the button face with no cruddy fringe colour. The button will probably resize to just fit the 16x16 image - just resize the button as needed after applying the icon image.

I haven't tried to do larger images, but the icon file format in XP, anyway, does support larger images within the same ico file. This might help for larger images.

No doubt any icon editor would be just as capable.
Good luck.
Mar 15 '08 #20
The IcoFX method is very good. It should be noted that in Access 2003 when you embed a bitmap it doesn't store the transparency but converts it to the button's background. Instead store it as a linked bitmap. You still need to reload the form (which reloads the picture) when the color settings change to update the the transparency.
If you need to specify a relative path, set it in VBA on Form Load relative to Application.CurrentProject.Path.
Here's my code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.     Dim control As Variant, button As CommandButton
  3.     For Each control In Form.Controls
  4.         If TypeOf control Is CommandButton And control.Tag = "editlistbitmap" Then
  5.             Set button = control ' you don't need to cast it but this way I got method completion
  6.             button.PictureType = 1
  7.             button.Picture = Application.CurrentProject.Path & "\edit1.ico"
  8.         End If
  9.     Next
  10. End Sub
  11.  
Aug 24 '08 #21
for me, this approach works:

1. open your image-file in the application "IrfanView"
2. save the file as ".ico" and choose the option "ICO: save transparent color" (wording approx., got only the german version)
3. now you can choose that file in access as image for a command including tranparency.
Jun 11 '10 #22

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Richard Hollenbeck | last post by:
I have pages that I want a particular person to download dozens of images. Instead of opening each image separately with right-clicks, I want to be able to have them simply click, and the program...
4
by: Els | last post by:
Hi, I would like an opinion on the following: I have a page which is made up of background-images with transparent linked images in front of it, which on hover show text in CSS popups. Due to...
11
by: Shane Suebsahakarn | last post by:
Hi all, This might be one of those things for which there is no workaround. I'm using A2K2, and using it to perform a very large batch ouput. Both the front and back ends are MDB files, so no...
8
by: Chad | last post by:
Should links automatically appear in the "visited" color as defined by the user's IE settings without having to add any special coding? I have a situation where the link was not changing color...
1
by: Kevin L | last post by:
Can anyone tell me the RGB values for the "Control" System Color? Thanks
3
by: bulwark_jrm | last post by:
I'm trying to duplicate functionality found in a Windows application at one of my clients. Essentially, another programmer was able to arrange a lot of search options into a single dialog box by...
0
by: Rave | last post by:
This is a long shot, but I thought I'd try it. I am currently using excel as an inventory tool. I currently have a hand-held scanner plugged into a laptop for reading barcodes. Using the "Find and...
1
by: Brian Kendig | last post by:
How do I take an index of a literal array, instead of a variable? That is, say I want to get the short name of a month. Can I do something like: $monthname = ("Jan", "Feb", "Mar", "Apr",...
3
by: Tamer Ibrahim | last post by:
Hi, I want to mimic the "Page Options" existing on the www.msn.com especially the change color feature on my site. Any helpful resources describe the idea of that will be most appreciated. Thank...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.