473,626 Members | 3,041 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Fill Image in odd shape

I am trying very hard to take an image and fill a shape with part of it.

The way I do it is get a rectangle for the basic shape,
add to a region, make some other shapes and exclude form region.
make a texture brush, then fill region with the brush.

It works on three parts of what I am doing but on the third time it seems to
be tiling the image.
I don't know waht I am doing wrong. Is there a better way to define a
region and draw what parts of the rectangle(image ) are left over--into it?

Any ideas?

Looks as though it moves left a bit and starts drawing then comes back to
the left side to finish the right side... therefore the image is toast. I
do it in the same way as I did for another image that works... Don't know
the problem

thanks,

Shane
Nov 20 '05 #1
4 2293
* "SStory" <Th*******@TAKE OUTTHISSPAMBUST ERsofthome.net> scripsit:
I am trying very hard to take an image and fill a shape with part of it.

The way I do it is get a rectangle for the basic shape,
add to a region, make some other shapes and exclude form region.
make a texture brush, then fill region with the brush.

It works on three parts of what I am doing but on the third time it seems to
be tiling the image.
I don't know waht I am doing wrong. Is there a better way to define a
region and draw what parts of the rectangle(image ) are left over--into it?


"Post your code."

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
Hi,

You should set the wrapmode and rectangle for the texture brush to
prevent tiling.

http://msdn.microsoft.com/library/de...ctorTopic7.asp

Ken
---------------------

"SStory" <Th*******@TAKE OUTTHISSPAMBUST ERsofthome.net> wrote in message
news:e9******** *****@TK2MSFTNG P11.phx.gbl:
I am trying very hard to take an image and fill a shape with part of it.

The way I do it is get a rectangle for the basic shape,
add to a region, make some other shapes and exclude form region.
make a texture brush, then fill region with the brush.

It works on three parts of what I am doing but on the third time it seems
to
be tiling the image.
I don't know waht I am doing wrong. Is there a better way to define a
region and draw what parts of the rectangle(image ) are left over--into
it?

Any ideas?

Looks as though it moves left a bit and starts drawing then comes back to

the left side to finish the right side... therefore the image is toast. I

do it in the same way as I did for another image that works... Don't know

the problem

thanks,

Shane


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.6 - Release Date: 6/25/2004
Nov 20 '05 #3
have tried that but then nothing prints.

I define the rectangle as the right side of my working rectangle-desired
width, and of course the height of the working area.

like so
rectf(outerwidt hpix-w,0,w,outerheig ht)
where w is the desired with of the image
add the rect to a region
Then I chop of the ends to make corners and as a graphics path, exclude that
path from the region, so that I am left with a trapezoid region.

Then I load my image into memory being the height and width and rotate then
create a texture brush, then fillregion with it.

Question. The region doesn't cause coordinates to become relative to it
does it? In other words 0,0 is not the top of that region if it was defined
by a rectf with a left,top of 100,0, correct?

when I try to create a texture brush with warpmode set to clamp which I
assume means start at left boundary and don't tile, and with a rect which is
the same rectangle I used for creating the region, it paints nothing.

Any ideas on that?

Is there any other way?

Shane

"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Hi,

You should set the wrapmode and rectangle for the texture brush to
prevent tiling.

http://msdn.microsoft.com/library/de...ctorTopic7.asp
Ken
---------------------

"SStory" <Th*******@TAKE OUTTHISSPAMBUST ERsofthome.net> wrote in message
news:e9******** *****@TK2MSFTNG P11.phx.gbl:
I am trying very hard to take an image and fill a shape with part of it.

The way I do it is get a rectangle for the basic shape,
add to a region, make some other shapes and exclude form region.
make a texture brush, then fill region with the brush.

It works on three parts of what I am doing but on the third time it seems to
be tiling the image.
I don't know waht I am doing wrong. Is there a better way to define a
region and draw what parts of the rectangle(image ) are left over--into
it?

Any ideas?

Looks as though it moves left a bit and starts drawing then comes back to
the left side to finish the right side... therefore the image is toast. I
do it in the same way as I did for another image that works... Don't know
the problem

thanks,

Shane


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.6 - Release Date: 6/25/2004

Nov 20 '05 #4
What I basically want to do is drawimage to the original rectangle but have
it clip the corners as defined by my region.

Is there a way to do this without a texture brush?

Shane

"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Hi,

You should set the wrapmode and rectangle for the texture brush to
prevent tiling.

http://msdn.microsoft.com/library/de...ctorTopic7.asp
Ken
---------------------

"SStory" <Th*******@TAKE OUTTHISSPAMBUST ERsofthome.net> wrote in message
news:e9******** *****@TK2MSFTNG P11.phx.gbl:
I am trying very hard to take an image and fill a shape with part of it.

The way I do it is get a rectangle for the basic shape,
add to a region, make some other shapes and exclude form region.
make a texture brush, then fill region with the brush.

It works on three parts of what I am doing but on the third time it seems to
be tiling the image.
I don't know waht I am doing wrong. Is there a better way to define a
region and draw what parts of the rectangle(image ) are left over--into
it?

Any ideas?

Looks as though it moves left a bit and starts drawing then comes back to
the left side to finish the right side... therefore the image is toast. I
do it in the same way as I did for another image that works... Don't know
the problem

thanks,

Shane


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.6 - Release Date: 6/25/2004

Nov 20 '05 #5

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

Similar topics

1
2142
by: samlicon | last post by:
i have a java project to do , but what problem i encounter is how to fill / put an image of jpeg into a Reatangle in the code below please type the code in detail since i am an entry level students thanks a lot the code Listed below
2
2008
by: Koh | last post by:
My rollover image effect work fine in Netscape but not in Internet Explorer. Is there any important element or tag that I have miss out so it is not working in Internet Explorer? Below is my code, hope there is someone can help me. Thank you. <html> <head> <title>List of Products</title> <script language="JavaScript"> <!--
1
2680
by: Ms Yaqian Fang | last post by:
Hello, I want to highlight the clicked area on an image by placing another image on it. But it replaced the whole image, not the clicked area. My code is as following, can anyone please help me? Thank you!!!! <head> <script language="JavaScript" type="text/javascript"> function changeImagemap(newImage) { if (js > 1.0) document .src = eval(newImage + ".src"); } </script>
2
1416
by: Yaqian | last post by:
Hello, I want to highlight the clicked area on an image by placing another image on it. But it replaced the whole image, not the clicked area. My code is as following, can anyone please help me? Thank you!!!! <head> <script language="JavaScript" type="text/javascript"> function changeImagemap(newImage) { if (js > 1.0) document .src = eval(newImage + ".src"); } </script>
3
1762
by: Bart Schelkens | last post by:
Hi, I've put an image on my website. Now I want the user to be able to click on certain parts of the image. How can I do that ? Thx
7
1948
by: raghunadhs | last post by:
hi all! i am developing a GUI in v.b 6.0. it consists of some images (asume there are some images such as power controls, some switches... like that). i want to give a choice to the user so that suppose if he clicks on a menu "Color Palete", a window should appear containing so many colors, if he selects one color. then immediately the image on GUI should be filled with that color. i have done some experiments with "pset" which is...
3
1953
by: anthriksh2000 | last post by:
Hi, I want to have a image which has 4 people in it and i wnat that it should have image mapping. and when a particulat person is clicked upon in that image it should open a corresponding person HTML file in the new window . for that i used a software to create a image cordinates mapped to the corresponding person whcih i had saved in the same local folder . But now eben when we click any person nothing is happening in response ...
7
5218
by: David Stone | last post by:
Run into something recently that has left me a little puzzled. According to the examples in section 13.6.1 of html 4.01... <http://www.w3.org/TR/html401/struct/objects.html#h-13.6.1.1> I should be able to use <aelements with a specified shape and coords within a <mapso that I can use the links with an actual image and, at the same time, have the links appear as text. Something like the map associated with
0
1832
by: jemaxwell | last post by:
i have a image in my website that i have used with a map i want the image to resize when the browser size changes but i want to map to still work (resize too).. I know this is probably very basic, but can anyone help me with this? see my webpage code below. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html>
0
8259
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8192
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8696
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8358
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6119
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5571
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.