Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Hex Image
Author Message
octopi

Posted: Thu Feb 19, 2004 8:10 pm   Post subject: Hex Image

Makes a mozaic/pixelation type effect.

If I can find my hex functions I wrote last year I can make the size of the hex's variable, I just wrote a quicky drawhex function with fixed values.

heximage.zip
Description:
 You can change the hex.jpg image if you want.

Download
Filename:  heximage.zip
Filesize:  597.93 KB
Downloaded:  772 Time(s)

Sponsor
Sponsor

Catalyst

Posted: Thu Feb 19, 2004 8:21 pm   Post subject: (No subject)

thats cool
octopi

Posted: Thu Feb 19, 2004 9:33 pm   Post subject: (No subject)

 code: procedure drawdashedbox (x1,y1,x2,y2,len, clr1, clr2 :int)   var clr:int:=clr1   var assx, assy:int   for x: x1 .. x2 by len      assx:=x      if((assx div len) mod 2 = 1) then        clr:=clr1      end if      if((x div len) mod 2 = 0) then        clr:=clr2      end if      if((assx+len) > x2) then        assx:=assx-len      end if      drawline (x,y1,assx+len,y1,clr)      drawline (x,y2,assx+len,y2,clr)   end for   for y: y1 .. y2 by len      assy:=y      if((assy div len) mod 2 = 1) then        clr:=clr1      end if      if((assy div len) mod 2 = 0) then        clr:=clr2      end if      if((assy+len) > y2) then        assy:=assy-len      end if      drawline (x1,y,x1,assy+len,clr)      drawline (x2,y,x2,assy+len,clr)   end for end drawdashedbox

Uploaded new version, btw: you move the box around, and click the mouse when you have selected a part of the image.
jonos

Posted: Thu Feb 19, 2004 10:11 pm   Post subject: (No subject)

nice program!!!

are you using whatdotcolor to enlarge the selection?
octopi

Posted: Thu Feb 19, 2004 10:15 pm   Post subject: (No subject)

Yah, I just take the mouse co-ordinates and then use whatdotcolor to fill an array with about 30x30 pixels, and then I just loop threw the array, and pass the color to my drawhexagon function.

For my box(that you use to select the image area) I just used a loop, that shows the image, and I used my drawdashedbox procedure as shown above in this post.
jonos

Posted: Thu Feb 19, 2004 10:22 pm   Post subject: (No subject)

cool, im going to try to make that sometime!!!
octopi

Posted: Thu Feb 19, 2004 11:49 pm   Post subject: (No subject)

I uploaded another version, this one uses my triangle function.
octopi

Posted: Fri Feb 20, 2004 12:32 am   Post subject: (No subject)

Uploaded another version, This one has the parellelogram.
I know that the window utilization is messed (magnification doesn't fill screen.)

If you notice any other problems let me know.
Sponsor
Sponsor

 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 8 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: