I am drawing a square image with transparent background inside a pictureBox inside a Form with C#. I only want it to capture the mouse events with its visible part, but it happens that it captures events with its whole surface.
How can I make a half transparent image inside a pictureBox to capture mouse events only with its visible pixels in C#?
132 Views Asked by AudioBubble At
1
There are 1 best solutions below
Related Questions in C#
- Passing arguments to main in C using Eclipse
- kernel module does not print packet info
- error C2016 (C requires that a struct or union has at least one member) and structs typedefs
- Drawing with ncurses, sockets and fork
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- Configured TTL for A record(s) backing CNAME records
- Allocating memory for pointers inside structures in functions
- Finding articulation point of undirected graph by DFS
- C first fgets() is being skipped while the second runs
- C std library don't appear to be linked in object file
- gcc static library compilation
- How to do a case-insensitive string comparison?
- C programming: Create and write 2D array of files as function
- How to read a file then store to array and then print?
- Function timeouts in C and thread
Related Questions in WINFORMS
- What is this namespace ITypeOfObjectsBoundToListBox ? Couldn't find it
- How to Require Confirmation on Form Close When there is Changed Data in a DataGridView
- self updating drawings C#
- Missingmanifestresourseexeption in auto genereted code of ImageList
- Child form implement in C# Winform
- Cannot find InvalidCastException in C# Application
- some labels appear gray in Visual Studio 2010
- c# richtextbox search with 2 forms
- Menu out of place when application is in full screen by Windows API
- How to access the Index of a changed Selection in a Datagridview
- showing a black transparent box over picturebox with an Image
- how to deselect all in RichTextBox before selecting newly found text?
- How to remove white space between border and BackColor?
- Validation DataGridView Windows Forms
- Invoke of a UserControl doesn't work
Related Questions in MOUSEEVENT
- Mouse press event called twice
- How to create a boolean local variable as a result of MouseEvent?
- Detect mouse clicks on circles on HTML5 canvas
- How to detect whether touch slide is taking me out of browser window on tablets?
- Mouseenter fired multiple times in Firefox after moving node to another place in DOM
- how to implement mousemove after mousedown using js
- Strange text output of e.getSource() on MouseEvent e
- Event "While Button is Pressed"
- PsychoPy Recording Multiple Mouse Clicks
- how to implement mousemove while mouseDown pressed js
- how to avoid flickering on mouseenter event in jquery?
- How to check if key pressed when clicked event in java
- In WPF how can I control whether another button clicked
- How do I receive the MouseWheel event when mouse pointer is not in the window?
- how to avoid mouse event conflict with timer
Related Questions in PICTUREBOX
- showing a black transparent box over picturebox with an Image
- How to hide control when click outside it?
- c# move picturebox from an array of picturebox up when you hover mouse
- VB.NET Fading out button properly
- Switching images in picturebox
- Move windows form from a picturebox in C#
- How to zoom into a picturebox image without changing the image sharpness?
- More Fluent Image Movement
- Winforms Cursor
- Update picturebox
- C# PictureBox variable in a class
- How to get position from Image in PictureBox
- BackGammon Game
- Class With PictureBox Variable and Double. And more
- picture box crossed out C#
Related Questions in TRANSPARENT
- Navigation bar draw over content when using translucent status
- Transparent Activity in Android
- labeling and saving transparent layer in photoshop
- Transparency in Background Picture
- JLabel absorbs background from my mouse pointer coordinates JAVA
- How to hide scrolled content under fixed transparent header
- align transparent div over carousel background image in bootstrap
- Collapsed navbar is covering content behind it in bootstrap 3.3.4
- CSS Radial Transparency Center Only
- Make element transparent through multiple parent elements?
- android image serialization transparent png
- Android: AppBarLayout gradient background
- imageresizer transparent white png
- NetLogo 3D: Transparent Patches
- Can Telerik Themes be assigned to the BackColor property of elements?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
This will work for SizeMode of Normal and AutoSize:
otherwise you would probably have to do some calculations to get the pixel location.
If this works for you, you should also consider storing the bitmap in a variable instead of newing it up on every mouse event.
EDIT: I used 8 just as a delta value instead of zero to leave some space for almost completely transparent pixels, but of course you don't have to.