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 one of the methods of Graphics in vb. here the problem is
All the images are round in shape, and a black cureve is inside it.
When ever a user selects a yellow color the entire image except that black curve should be filled with that color. i can observe the co ordinates of the black curve and fill the remaing part with yellow. but it is a very slow process....
What should i do to get my image be filled with desired color with fastness.... if u know kindly help me
Thanks in advance
Raghunadhs.v
7 1947 kadghar 1,295
Recognized Expert Top Contributor
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 one of the methods of Graphics in vb. here the problem is
All the images are round in shape, and a black cureve is inside it.
When ever a user selects a yellow color the entire image except that black curve should be filled with that color. i can observe the co ordinates of the black curve and fill the remaing part with yellow. but it is a very slow process....
What should i do to get my image be filled with desired color with fastness.... if u know kindly help me
Thanks in advance
Raghunadhs.v
why dont you use a gif with transparences? let transparent the part that you want to change and change de backcolor of the object.
I think that may be easier.
Good Luck
I don't remember the details right now (and don't have time to search for it) but there is an API call to do a "flood fill". That'll do what you want. Try a bit of searching. I should have time in a day or two to go looking for it.
I could not get your idea, regarding to the filling the image with a particular color.
can u give me an example.
here the problem is the image consists of a black curve in the middle of the image. when ever we are filling the image with paritcular color, that black curve should not be effected. it should be in black only...
kindly reply me if u know how to do it...
Thanks in advance:
regards:
Raghunadhs.v
ok, killer, i will see that flood fill method...
Thanks,
regards:
raghunadhs.v
ok, killer, i will see that flood fill method...
I should be able to look it up in an hour or two. In the meantime, just be aware that the floodfill will start from the specified point, and works like what you'd expect from a graphics program. So if you started at a point inside your black shape, for example, you would fill the shape with a colour.
(I always assumed you didn't want to just fill the entire image, because you could do that just by setting background colour and doing CLS.)
Hi killer!
thanks for your regular correspondence. i saw an example of "flood fill method" but could not be able to understand that. so what i did was
(1): i found the black curve's co-ordinates by using the co-ordinates of the mouse click event.(... i collected co-ordinares by cliking the mouse on the curve, so the mouse's click event gives the x,y values of each pixel.. like that myanually i collected those stuff into an array)
(2):
now i filled the image with the user's color and then by using "pset" method i fill the co-ordinates that are in my array with black color one by one.
finally i got a image what i required.... actually this is applicable to pictur box only .. so i replaced my image to picture....
Killer... actually i don't know whether it is a proper way or not... but i have less time so i did like this.. if there is any othere methodology pls let me know...
And pls provide some sample code to the flood fill method.. it may use full to me in little future.
Thanks
regards:
raghunadhs.v
Download the floodfill example from here. It's a simple form with a few lines of code, and produces wonderful results. No instructions, but you shouldn't have too much trouble picking the code apart.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Rob Manger |
last post by:
Hi All,
I am hoping someone can help me. I am trying to setup my main page so that
when the user moves the mouse over an image, it changes the source (got this
working). When the user CLICKS on the image (it is a link to the content
page) it changes to a third image AND STAYS THERE. ie: so the iamge won't
change back to the omouseoff image. Does this make sense?
Also, how do I "preload" the images before they are even needed? eg:...
|
by: Matt |
last post by:
In the following code, I have 2 questions regarding submit button with image.
1) Does this code <input type="image" name="populate" src="populate.gif">
behave the same as an HTML submit button with image populate.gif?
When I click p1 or p2 button, it will post the page to process.asp.
2) When I check the checkbox, I want the image in submit button change
from populate.gif to validate.gif. Unfortunately, the code
InputForm.p2.src =...
|
by: Matt Silberstein |
last post by:
I am trying to make a page that will be 800px wide. That is, I have an
800px image. I want the content of the page centered. I can do that
fine. On the top, I want an image logo with a text menu placed on top.
Right now I have that working just fine in Mozilla and horrible in IE.
The page validates just fine for both CSS and HTML. This should be
easy, but somehow I just don't get positioning.
Here is the link to the page:...
|
by: lc |
last post by:
I'm building a small image gallery type of site and along with it I'm
adding a few pages for site maintenance. One of the maintenance
functions is to replace an image (haven't tried delete and new image
yet). All available images sit in a subfolder.
In one par of the form with image replace request I show a datalist
hooked up to a paging data table. The other part of the form show a
single big image that's being edited and is hooked up...
|
by: Yeah |
last post by:
I have a web site which changes the header logo based on the upcoming
holiday.
For example, from December 10th to 25th, XMAS.JPG is displayed. From October
20th to 31st, HALLWEEN.JPG is displayed. Etc. etc. If today's date is not
near a holiday, then the default LOGO.JPG is displayed.
A while back, I was looking for a JavaScript that does this automagically.
But each snippet I found traditionally displays the default logo for a...
| |
by: Nel |
last post by:
Hi all,
I am struggling with understanding a small eregi problem in php4.
My code:
<?PHP
$htmlsource = '<img src="pics/hotdog.gif"> text text <img
src="pics/silly%20sausage.gif"> ';
eregi('(=")(pics/)(+...)(")',$htmlsource,$imagesintext);
?>
|
by: Kirthikaiitm |
last post by:
Hi,
I am totally new to Javascript and i am struggling to work with JScript.
Pls help me in this issue.
I have form with save,cancel and delete as image buttons.
Eg.
My code is <input type="image" src=/image/bt_save.jpg....>
I want these image buttons to get disabled once i enter the form.
On clicking any field in form i want this image button to get enabled.
|
by: martin2106 |
last post by:
Hi members,
I was searching for a specific script and found it here.
But the problem is that it works in Firefox but doesn`t work in Internet Explorer.
Who has the solution to get this script working in IE?
<script type="text/javascript">
function MyHead() {
var list = new Array();
|
by: thesti |
last post by:
hi,
how to display a gif image, in HTML but when it reaches the the last frame, it stops. don't loop the animation.
thank you.
|
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...
|
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,...
| |
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...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |