By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,516 Members | 1,194 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,516 IT Pros & Developers. It's quick & easy.

Region and PictureBox.Image Resize

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.