Draw A Shape In GDI+ That Overlays Opaque Pixels With Transparency?

Feb 24, 2010

I have a mask bitmap (bmpMask) that I am drawing onto a destination bitmap (bmpDest). Both bitmaps have alpha channels but are already full of opaque content. What I want to do is produce transparent areas using GDI+ 'Draw...' methods on bmpMask so that bmpDest shows through when I draw bmpMask over it.Of course gMask.DrawLine(Pens.Transparent, 0, y, wMax, y) causes no change to bmpMask, because GDI+ works as designed and doesn't draw anything when transparent. Even with semitransparent colors, only the r,g,b values of bmpMask's pixels are updated.

View 1 Replies


ADVERTISEMENT

Draw Single Pixels And Rectangles On Any Web Browser?

Nov 17, 2010

My aim is to draw single pixels and rectangles on any web browser.

I ve been thinking alot about this and I think I that there might be 2 ways to do this:

1) Send message api maybe?

2) Direct 3d hook with C++ (Although this is quite complicated)

So my questions are:

Btw the use for it is to detect a certain pixel on the webbrowser and draw on it.

Don't ask why since it is quite complicated and I know also how to use Send message api and I once managed to program a direct 3d hook (but for a 3d game which was based on direct x SDK) with C++ although im not sure if it will work due to webbrowsers dont work with directx.

View 7 Replies

Use AntiAliasing When Draw A Shape?

Feb 26, 2009

How I can to use AntiAliasing when draw a shape ? Like draw a circle by me.circle on a form by AntiAliasing.I use VB6.I have 16 years old.

View 3 Replies

Draw String On Top Of Rectangle Shape?

Oct 7, 2011

I'm using e.graphics in the Me.Paint event to draw a string in the form. There is a rectangle shape with gradient in the form, and the string is supposed to be drawn on top of the rectangle shape. However, when I run the program, the string is drawn under the rectangle shape, and is therefore invisible... How do I fix this?

View 2 Replies

Cause An Event - Draw A Solid Black Line 25 Pixels From The Top Of The Form?

Jan 31, 2012

I see that the Line method is replaced with DrawLine, however; it seems like DrawLine must treated as an object as follows:

Private Sub Form1_Paint(ByVal sender As Object, ByVal e _

As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint

Draw a solid black line 25 pixels from the top of the form.[code].....

When I attempt to use this code (call it), I must somehow bring about an event, but I haven't found how to do that.How do I "call" this sub?

View 13 Replies

Draw Shape On A Form Using Mouse Down Event In Vb?

May 9, 2009

I've to draw LInes and rectangles,etc in vb on a form and using mouse down event.

View 2 Replies

Interface And Graphics :: Draw A Shape From A Button?

Jul 25, 2009

Ok..I think it's very simple but I'm still a begineerI'll try to make it clear I need to draw a rectangle when I click on the button..what is the required code?

Quote:
Public Class Form1
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)

[code].....

View 1 Replies

Make Multi Selection (draw Shape) On The Picturebox?

Jun 12, 2009

Currently I'm trying to make multi selection (draw shape) on the picturebox but no matter how i edit my code, it jus dn draw any square or circle when I click on my button (either circle or square).

Below are the codes that i'm currently working on:

Public Class Page_2
Public blnCircleClicked As Boolean 'Is The Circle Tool Clicked?
Public blnSquareClicked As Boolean 'Is The Square Tool Clicked?

[Code]......

View 5 Replies

Pixel Counter - Count The Black Pixels The Grey Pixels The More Grey Pixels

Jul 27, 2009

I'm trying to make a -what i thought would be simple app.My intention was to build program that:1) i'd provide a grayscale image2) the program would count the black pixels the grey pixels the more grey pixels etc. (the hue) and the white3) would make the percentage sum of all pixels, that is: 300.000 black pixels (rgb 0 0 0) etc. given that 0 is the black, 100 the white. e.g a simple grayscale image is 55.2 white

This was my way and i don't think that is useful:

First of a button to convert the image to greyscale:

Dim bm as new Bitmap(source.Width,source.Height)

Dim x

Dim y

[CODE]...

Secondly, -and that's the stupid way- i did -or better i wanted to do- this: i put the code to dynamically create labels, each label having the colour of a pixel as background colour and as text the colour converted to rgb

The third step which i intended to do (i couldn't get pas two) was to sum up the labels etc.

View 6 Replies

.net - Overlays Using Streams Resizes An Image?

Dec 28, 2009

I found that the overlay function was working fine. However, it seems that if I use the overlay function while reading an image from a stream, that it would enlarge the picture before overlaying it.

ie:

overlay = New Bitmap(stream)
g.DrawImage(overlay, 0, 0)

Seems to enlarge the image before overlaying it, whereas this:

overlay = New Bitmap(My.Resources.Pic)
g.DrawImage(overlay, 0, 0)

Seems to overlay the image fine.

What could be the reason for this?

View 1 Replies

Painting An Opaque Black Rectangle?

Mar 5, 2009

I'm not sure if this should be here or in the Graphics subforum. Basically, I want to simulate the monitor(s) going black (it's an immature April Fool's Day prank). My initial thought was to create a borderless form that is the size of all the monitors with a backcolor of black. Then, slowly, increase the opacity of the form. This approach works great as far as the visual effect I'm trying to achieve...the problem is that it's a form. If the form is on top - while you can *see* windows below it - you can't interact with them. I'm wondering if there is a way to create the same visual effect without using a form so that the PC will remain usable while the monitor appears to slowly be getting darker?

View 1 Replies

C# :: How To Drop A Shape Inside Shape In VISIO

Mar 23, 2011

I am using Rack-mounted Equipment (US units).VSS as stencil. I need to Connect a server on Rack.

View 1 Replies

.net - Opaque Form Overlay Without Covering Task Bar?

Aug 10, 2010

Using Visual Studio 2008 and VB.NET ...

I've created a form (OpaqueForm), which is an intermediary form between other forms which I will open with ShowDialog. The idea is that when I want to show a form using .ShowDialog, this OpaqueForm, with an opacity other than 100%, sits in between the main form and the dialog form, effectively "greying out" the underlying main form.

The OpaqueForm has the FormBorderStyle property set to None, and accepts in the constructor a Form object on which it invokes .ShowDialog. The effect works fine, but there is one caveat. The task bar is also covered by the OpaqueForm; I am assuming because it has a FormBorderStyle of None and a WindowState of Maximized.

I don't want the OpaqueForm to cover the Task Bar, because it would be impolite to have my modal form lock out a user from switching between tasks. How could I go about preventing OpaqueForm from covering the Task Bar, too, while still using a FormBorderStyle of None?

View 3 Replies

Colouring In A Picture Using Overlays Or Filled Polygons?

Jun 3, 2012

I am trying to create a VB.net form application to visually fill in a floor plan with different colours according to reservation status.The basic floor plan is white and the idea is to colour in the various apartments in different colours depending on some variables.I have tried overlaying .png pictures on top of each other but this doesn't work due to the non-true nature of transparency in visual studio as soon as you overlay more than 2 PNGs.Not much more success with drawing polygons either.

View 1 Replies

Form Background - Image Partially Overlays Itself

Jun 22, 2010

I added an image as the background image for a form in VB.net. When I run the program, after approx. 5-6 seconds, the image partially overlays itself, as in an offset overlay of the underlying image. I never had this problem in VB6, but I did have it the other time I used a background image on a form in VB.Net.

View 1 Replies

Semi-transparent Form With Opaque Controls?

Oct 30, 2009

I have a 75% transparent form and I would like the controls and elements that I place on it to be 100% opaque. I've searched but didn't turn up any results.

View 4 Replies

Convert Pixels To Cm/inch Or Cm/inch To Pixels?

Feb 28, 2009

i have a problem with the Size in VB.Net I think the Control Size in VB.Net Is Pixels so I want to enter this size cm/inch

I want To Convert Pixels to cm/inch or cm/inch to Pixels

View 4 Replies

Get DataGridView To Draw The Way A Professional Control Should Draw?

Apr 26, 2010

I need to get the DataGridView to perform the way it should perform. I'm new to the .NET environment, but I learn fairly quickly. However, I find it difficult to decipher themassive black box of the DataGridView control enough to make it do anything other than what it already does--Draw very slowly.

View 3 Replies

Pixels In Cm Or Mm?

Oct 16, 2009

i`m trying to find in cm or mm the area of a frame (capture image).The picturebox has dimensions height:456 and width:553 PIXELS.So the total number of pixels are 456 x 553 = 252,168

If i compare image 1 with image 2 i can locate and draw a rectangle around that area of pixels that are different.i can get the width and the height of this rectangle in PIXELS.e.g Height:49 Width:33 PIXELS

How can i covert these into cm or mm. What i need to know for the conversion?

I know dpi: dots per inch but what`s the value for my rectangle?

View 8 Replies

Addressing Pixels In A Bmp?

May 25, 2010

I would like to believe that this code will display a horizontal line halfway across the PictureBox pbxData. In fact, what it does is create the BitMap and then blow up with a memory violation when trying to copy the BitMap into the PictureBox. The code that alters the array is commented out because I don't know how to address the elements of the array.

how to make this into useful code?

Imports System.Runtime.InteropServices
Public Class Form1
Private b1 As Bitmap

[Code].....

View 13 Replies

How To Get Pixels Of Image

Nov 11, 2011

How can we get the pixels of an image in a fast way?

View 1 Replies

Best Way To Clear All Pixels In A Bitmap?

Aug 28, 2009

Was just wondering if there is a way to quickly clear all pixels in a bitmap without creating a new one?

View 1 Replies

Converting Pixels To Points?

Mar 18, 2006

Is there a way of converting pixels to points? The dimensions in VB are in pixels, but Office COM such as WordApp.Resize are expressed in points. So trying to align app windows is a mess.I guess the ratio of pixels to points varies from one monitor to another(?), so this would need to be calculated at run time.I tried a nifty trick of doing Me.Font.SizeInPoints / Me.FontHeight but that doesnt seem to be quite right or a very sensible way of doing it.

View 2 Replies

How To Work With Image And Pixels

Feb 22, 2010

how can i get a full code or full information how to work with image and pixels i want to work with image by pixels as integer number not as color?

View 5 Replies

Move The Mouse Down Like -10, -10 Pixels?

Sep 16, 2009

Is there a "MOUSEEVENTF_Click"? Also,How would I change this code so that it will click when I move/click my mouse wheel?

If MOUSEEVENTF_WHEEL Then
Call mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
Call mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
End If

EDIT: How would I move the mouse down? Like -10, -10 pixels? or something like that.

View 4 Replies

[2008] Get Certain Pixels From Screen

Feb 14, 2009

i made this class to get certain pixels from screen:

[Code]...

Now i have lets say and array of pixels Example: Pixel 1 position X:100 Y:200 Red: 200 Green: 30 Blue: 40 Now i need to search all the sreen to find that pixel witout knowing its position. I need to have an output of number of results found and their position tnx.

View 9 Replies

Forms :: Uses A Button To Draw A Line And A Second Button To Draw A Rectangle?

Oct 14, 2011

I have a form that uses a button to draw a line and a second button to draw a rectangle. I have a third button to clear the form but can't find a code example to code the Clear button.

View 4 Replies

.net - Picture Box Transparency In Vb?

Feb 18, 2012

When i run my code, the picture box has a background colour, even though I have set the background colour to transparent in the properties window.

View 1 Replies

Flash - Transparency In Swf In .net?

Mar 9, 2010

how can i control swf background transparency in vb.net either with flash.ocx or if there is any other way.so that if i have a swf animation block with red in background and some text written with yellow. now how can i remove that red background in vb.net.actually i want to make a system so that i can choose any color as transparency key for swf like in tv channels logos.

View 2 Replies

Get Image Transparency To Come Through In VB?

Jul 20, 2009

how you can get image transparency to come through in Visual Basic? Because if you try to put an image with some transparent sections on it on a form, the transparency turns into the form background colour (Though you could change the background image to whatever you want displayed under the image, but that's not the point) and basically I can't find any way to do irregular transparencies.

Alright, that's not very simple. I'll try to give an example:

You have an animated GIF of...say...fireworks. And it has a transparent background. Now say you have a few labels with text in them. When you draw the picturebox over the labels, the text in the labels is covered by the background of the fireworks, even though it's transparent. You can't see the labels. You want to see the fireworks exploding over the text

I can't see any way of getting around this, other than doing it in another program and putting the text and fireworks into one PictureBox. but it would be so convenient if it could work in Visual Basic, because you can control the text the in the labels and keep the animated "fireworks" exploding at the same time without using multiple animated images.

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved