473,387 Members | 2,436 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,387 software developers and data experts.

Region and PictureBox.Image Resize

continuation of my previous post, thanks to all those that contributed with
answers

I am creating a control that will take an image and make parts of it
transparent, this is done by creating and then applying a region to the
control. The control inherits from picturebox and works fine when loading
the image into the control, the problem that I am having now is, once the
control is loaded and the image is displayed, if the user resizes the
picturebox, the image does not extend to the new properties and is confined
to the specified region e.g. the image stretches correctly but can only be
seen in the area specified by a region, is there a way to disable this
region once the image is loaded and still maintain the transparency
correctly (irregular shape) or is this correct.

code bits...........

me.region = transparentregion
me.image = bmpNewTrans (after having transparent regions excluded)

graphics stuff to smooth the image and redraw it

me.refresh
thanks in advance

Mark
Nov 20 '05 #1
1 3265
I don't recall seeing your last post, but to answer this query....

at the OnResize event of your control recreate transparentregion then set it
to the control.

Protected overrides Sub OnResize(ByVal e As System.EventArgs)
MyBase.OnResize(e)
Region = CreateTransparentRegion()
End Sub

Function CreateTransparentRegion() As Region
'code to create and return a region
End Function

"M West" <mw***@ndirect.co.uk> wrote in message
news:c8**********@news7.svr.pol.co.uk...
continuation of my previous post, thanks to all those that contributed with answers

I am creating a control that will take an image and make parts of it
transparent, this is done by creating and then applying a region to the
control. The control inherits from picturebox and works fine when loading
the image into the control, the problem that I am having now is, once the
control is loaded and the image is displayed, if the user resizes the
picturebox, the image does not extend to the new properties and is confined to the specified region e.g. the image stretches correctly but can only be
seen in the area specified by a region, is there a way to disable this
region once the image is loaded and still maintain the transparency
correctly (irregular shape) or is this correct.

code bits...........

me.region = transparentregion
me.image = bmpNewTrans (after having transparent regions excluded)

graphics stuff to smooth the image and redraw it

me.refresh
thanks in advance

Mark

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.683 / Virus Database: 445 - Release Date: 12/05/2004
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Pums | last post by:
I am writing a code to resize an image to fit in the picturebox so that the length/ height ratio of the image remains same. so, i have written one function to resize image and in that function...
2
by: active | last post by:
Problem: The PictureBox display appears to have the image cut off. I.e., the image bottom does not display although the PictureBox has room for it. It occurred to me that what was displayed was...
3
by: Tom | last post by:
I have a picturebox on my VB.NET form. The picturebox size mode is set to stretched. I then load an image into that form and display it. As the user moves the mouse over the form, I want to get and...
6
by: Rich | last post by:
Hello, I am putting together a simple picture viewing program to view jpg. bmp pictures. I have the picturebox sizemode set to autosize. I have the picturebox in a pannel set to autoscroll, so...
0
by: mhospodarsky | last post by:
Hi-- I am using VB.Net 2002 for this app. I am working with Tiff and jpeg images. I have a picturebox set up that I use to view the images. I have the picture box inside of a scrollable...
4
by: TomA | last post by:
Hi All, I have a picturebox on a form containing the photo of a person. As you advance through the records, the photo updates. Rather than storing the images in an inefficient blob field in a...
4
by: wasishincar | last post by:
I'm trying to read a bitmap and zoom in/out it on screen. I wrote some code but it did not perform as I expect. The bitmap shift 1 pixel to the upper-left coner when zooming in/out button was...
2
by: =?Utf-8?B?Sm9uIFBhcnJ5?= | last post by:
Hi, I've got a Picturebox, into which I am putting a frame bitmap from a video camera. The camera bitmap is larger than the picturebox, which has SizeMode set to "Zoom" which causes the bitmap...
3
Raventara
by: Raventara | last post by:
Hi all, I have a program which will routinely update the image of a picturebox and resize the picturebox to keep the aspect ratio of the image in tact. The problem I am having is that after about...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.