Jump to content

Round Button


Jam00
 Share

Recommended Posts

martin,

I have just come back to find you here - glad to have another brain to help!

Do you get a transparent .gif when you display it? I could only think that there was an XP theme messing with the display - I use Vista, but as basic a display as I can get away with.

I am afraid that my knowledge of graphic formats is not very deep. I understand .bmps quite well, and the differences between them, .jpg, .gif, .png, etc, but little about this kind of problem. Any help you can give would be much appreciated - I am always happy to learn :-)

M23

Hi Melba,

Yes I get a transparent gif which is why I wandered if Jam00 could show the code he was using because I thought maybe he had saved the button you used as a bitmap or something. He got it working with an icon so I think it is possible he didn't have a transparent gif.

My knowledge of graphics is very poor so anything I say in that area is to be treated with scepticism and you won't be able to learn much from me :). In fact I find the whole area a bit of a mystery, so if you understand some of it maybe you could help me. I find the connection between images and bitmaps and graphic objects to be very confusing and when I have tried to look them up to undertsand them I have failed. I don't get what is actually happening when you create an image from a bitmap or a bitmap from an image, and why you can sometimes copy from an image to a bitmap but not from a bitmap to an image (or is it the other way round?) etc etc. If you, or anyone else, can you suggest a link or something that explains that area I would be very pleased.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Jam00

Try this.

This works on my XP. Whereas, the other examples posted did show the corners.

This approach is from the help file.

I tried this example with a png and a bmp image file and it did not work.

'gif' image files work.

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Local $PicWidth = 21
Local $PicHeigth = 21
$gui = GUICreate("test transparentpic", 400, 300)
GUISetBkColor(0x00FF00, $gui); <- Background colour of GUI
GUISetState()

;   90, 90 is x,y position on the main GUI ($gui)
$pic = GUICreate("", $PicWidth, $PicHeigth, 90, 90, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $gui);
;GUICtrlSetBkColor(-1, 0x000000); <-Background colour of image you want transparent (Appears not to be needed)

; Next Statement: 0,0 is x, y position on child GUI ($pic)
$hPic = GUICtrlCreatePic("button.gif", 0, 0, $PicWidth, $PicHeigth)

GUISetState();

While 1

    $iMsg = GUIGetMsg()

    Switch $iMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hPic; The background, being transparent, is not clickable.
            MsgBox(0, "", "Hit")
    EndSwitch

WEnd

Martin

I have read that the bitmap class is a subclass of the image class.

The bitmap class has all the bell and whistles, more features.

If you can do an operation on an image class object, you can carry out the same operation on a bitmap class object.

However, if you can do an operation on a bitmap class object, you may not be able to carry out the same operation on an image class object.

Malkey

I await correction.

Edit:11Feb2009

Found a reference to image and bitmap classes at:-

http://msdn.microsoft.com/en-us/library/ms534420(VS.85).aspx

Edited by Malkey
Link to comment
Share on other sites

  • Moderators

martin,

Sorry to disappoint you - I should have said that I understand the structure of .bmps quite well. A long time ago I coded something that changed the colour of a .bmp "background" to match the GUI background - a sort of pseudo tranparency. The results were variable - some were definitely a bit iffy! Then the world moved on to more accommodating formats (.gif and .png) and all my hard work became redundant - 'twas ever thus.

However, the programming aspects of image manipulation are a bit of a mystery - as I prove to myself on regular occasions!

Malkey,

I hate to tell you, but your code shows the .gif with the corners on my Vista machine - and I can click on them!

M23

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Okay, thanks that's very good! You're really good!

EDIT:

Then as now I have another problem:

I've got it now with icon, because I did not know yet how it goes with Gif, but since I have the problem that that pic because it is transparent where the background color shows, I need it but the pic shows what it is!

Skin.rar

Edited by Jam00
Link to comment
Share on other sites

  • Moderators

Jam00,

With your code I can see the background with your icon, but not with my .gif (see below).

I will think about this some more - but I am afraid that I have very little idea of where to go next!

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

Jam00,

I still see the backgrounds on my machine - but if you are happy then I am very pleased.

Good luck with the rest of your script - I hope it is easier than this part!

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...