Image Splicing Effect Challenge (Part 1)

I ran across a neat image effect on this image:
Rock In Rio
Thought it might be neat to see how different people in the forums would go about doing this...
Anyhow. Looking forward to your ideas. Take care.
UPDATE*
This thread has been continued into the following thread:
Image Splicing Effect Challenge (Part 2)
“If you want something you've never had, you need to do something you've never done.”
Don't forget to mark
helpful posts and answers
! Answer an interesting question? Write a
new article
about it! My Articles
*This post does not reflect the opinion of Microsoft, or its employees.

I am early staking my claim to pathclip.
Imports System.Drawing.Drawing2D
Public Class Form3
Private path1 As New Drawing2D.GraphicsPath
Private BorderColor As Color = Color.Goldenrod
Private MouseDownIndex As Integer = -1
Private MouseDownX, MouseDownY, MouseDownBmpX, MouseDownBmpY As Integer
Private OffsetX, OffsetY, SliceWidth, SliceStep As Integer
Private bmpSlice As Bitmap = New Bitmap("C:\bitmaps\metallica\metallica bw.jpg")
Private bmpBack As Bitmap = New Bitmap("C:\bitmaps\metallica\metallica background logo.png")
Structure bmpPoint
Public x As Integer
Public y As Integer
Public bmp As Bitmap
End Structure
Private bmpPointList As New List(Of bmpPoint)
Private Sub Form5_Load(sender As Object, e As EventArgs) Handles MyBase.Load
InitilizeControls()
Form5_Resize(0, Nothing)
End Sub
Private Sub PictureBox1_Paint(sender As Object, e As PaintEventArgs) Handles PictureBox1.Paint
With e.Graphics
'draw background fit to window
Using bmpScene As Bitmap = New Bitmap(PictureBox1.ClientSize.Width, PictureBox1.ClientSize.Height)
Using g As Graphics = Graphics.FromImage(bmpScene)
'make temp image, fit to window
g.DrawImage(bmpBack, 0, 0, bmpScene.Width, bmpScene.Height)
'copy temp image to background
If CheckBox2.Checked Then
'add fuzzy
Dim t As Integer = NumericUpDown7.Value + 1
If t > 1 Then
For y = 0 To bmpScene.Height - 1
For x = 0 To bmpScene.Width - 1
If x Mod t = 0 And y Mod t = 0 Then
bmpScene.SetPixel(x, y, Color.White)
End If
Next
Next
End If
.DrawImage(bmpScene, 0, 0)
End If
End Using
End Using
'draw each slice path with inner bitmap
'set translate for global scene
.SmoothingMode = SmoothingMode.AntiAlias
.TranslateTransform(OffsetX - SliceWidth, OffsetY - SliceStep)
For i = 0 To bmpPointList.Count - 1
Using tbmp As Bitmap = bmpPointList(i).bmp.Clone
'setup coordinate origin for this slice
.TranslateTransform(SliceWidth, SliceStep)
'fade slice border edge
If NumericUpDown8.Value > 0 Then
Dim fadewidth As Integer = NumericUpDown8.Value * 10
'calc local coordinate of upper left slice on inner movable bitmap
Dim x2 As Single = path1.PathPoints(3).X - bmpPointList(i).x
Dim y2 As Single = path1.PathPoints(3).Y - bmpPointList(i).y
'calc angle of slice
Dim dx As Single = path1.PathPoints(0).X - path1.PathPoints(3).X
Dim dy As Single = path1.PathPoints(0).Y - path1.PathPoints(3).Y
Dim x1, y1, x3 As Integer
Dim oldClr, newClr As Color
'add fade to temp inner bitmap along edges of path
For y1 = y2 To y2 + dy
x2 += dx / dy
For z = 0 To fadewidth
x1 = Math.Floor(x2) + z
If x1 > 0 And x1 < tbmp.Width And y1 > 0 And y1 < tbmp.Height Then
'left side
oldClr = tbmp.GetPixel(x1, y1)
newClr = Color.FromArgb((255 \ fadewidth) * z, oldClr.R, oldClr.G, oldClr.B)
tbmp.SetPixel(x1, y1, newClr)
x3 = x1 + SliceWidth - (2 * z)
If x3 > 0 And x3 < tbmp.Width Then
'right side
oldClr = tbmp.GetPixel(x3, y1)
newClr = Color.FromArgb((255 \ fadewidth) * z, oldClr.R, oldClr.G, oldClr.B)
tbmp.SetPixel(x3, y1, newClr)
End If
End If
Next
Next
End If
'draw the image slice using the path clipping
.SetClip(path1)
.DrawImage(tbmp, bmpPointList(i).x, bmpPointList(i).y, tbmp.Width, tbmp.Height)
.ResetClip()
'draw border outline path
If CheckBox1.Checked Then .DrawPath(New Pen(BorderColor, 2), path1)
End Using
Next
If CheckBox2.Checked Then
.ResetTransform()
.DrawString("tommytwotrain", New Font("Rockwell Extra Bold", 12), New SolidBrush(BorderColor), 0, PictureBox1.Height - 30)
End If
End With
End Sub
Private Sub PictureBox1_MouseDown(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseDown
'determine which slice was clicked
Using path2 As Drawing2D.GraphicsPath = path1.Clone
Dim Matrix1, matrix2 As New Matrix
MouseDownIndex = -1
Matrix1.Translate(OffsetX - SliceWidth, OffsetY - SliceStep)
path2.Transform(Matrix1)
matrix2.Translate(SliceWidth, SliceStep)
For i = 0 To bmpPointList.Count - 1
path2.Transform(matrix2)
If path2.IsVisible(e.X, e.Y) Then
MouseDownIndex = i
MouseDownX = e.X
MouseDownY = e.Y
MouseDownBmpX = bmpPointList(MouseDownIndex).x
MouseDownBmpY = bmpPointList(MouseDownIndex).y
Exit Sub
End If
Next
End Using
End Sub
Private Sub PictureBox1_MouseMove(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseMove
If MouseDownIndex >= 0 Then
'move the image if dragging
Dim thisbmptom As New bmpPoint
thisbmptom = bmpPointList(MouseDownIndex)
thisbmptom.x = MouseDownBmpX - (MouseDownX - e.X)
thisbmptom.y = MouseDownBmpY - (MouseDownY - e.Y)
bmpPointList(MouseDownIndex) = thisbmptom
thisbmptom = Nothing
PictureBox1.Invalidate()
End If
End Sub
Private Sub PictureBox1_MouseUp(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseUp
MouseDownIndex = -1
End Sub
Private Sub Form5_Resize(sender As Object, e As EventArgs) Handles MyBase.Resize
Dim t As Integer = Me.ClientSize.Height - Panel1.Height
If t > 100 Then PictureBox1.Height = t Else PictureBox1.Height = 100
OffsetX = NumericUpDown3.Value * 10
OffsetY = NumericUpDown4.Value * 10
SliceWidth = NumericUpDown6.Value * 10
SliceStep = NumericUpDown5.Value * 5
'create the slice outline path geometry
Dim w1 As Single = PictureBox1.ClientSize.Width
Dim h1 As Single = 0.7 * PictureBox1.ClientSize.Height
Dim x1 As Single = 0.1 * w1
Dim a As Single = NumericUpDown2.Value * 10 / 57.3
Dim x As Single = Math.Cos(a) * h1 / Math.Sin(a)
Dim thePolygon() As PointF = {New PointF(x1, h1), _
New PointF(x1 + SliceWidth, h1), _
New PointF(x1 + SliceWidth + x, 0), _
New PointF(x1 + x, 0), _
New PointF(x1, h1)}
path1.Reset()
path1.AddLines(thePolygon)
PictureBox1.Invalidate()
End Sub
Private Sub NumericUpDown1_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown1.ValueChanged
'create images for number of slices
bmpPointList.Clear()
Dim thisbmpTom As New bmpPoint
For i = 0 To NumericUpDown1.Value - 1
thisbmpTom.bmp = bmpSlice
bmpPointList.Add(thisbmpTom)
Next
Form5_Resize(0, Nothing)
PictureBox1.Invalidate()
End Sub
Private Sub NumericUpDowns_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown2.ValueChanged, NumericUpDown3.ValueChanged, NumericUpDown4.ValueChanged, NumericUpDown5.ValueChanged, NumericUpDown6.ValueChanged, NumericUpDown7.ValueChanged, NumericUpDown8.ValueChanged
'general settings
Form5_Resize(0, Nothing)
PictureBox1.Invalidate()
End Sub
Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click
Dim cd As New ColorDialog
If cd.ShowDialog Then
BorderColor = cd.Color
PictureBox2.BackColor = BorderColor
End If
PictureBox1.Invalidate()
End Sub
Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged, CheckBox2.CheckedChanged
'border, background
PictureBox1.Invalidate()
End Sub
Private Sub InitilizeControls()
PictureBox1.BackColor = Color.Black
PictureBox1.Dock = DockStyle.Bottom
PictureBox2.BackColor = BorderColor
Panel1.Dock = DockStyle.Top
CheckBox1.Checked = True
CheckBox2.Checked = True
NumericUpDown1.Value = 4 'slices
NumericUpDown1.Maximum = 7
NumericUpDown1.Minimum = 1
NumericUpDown2.Value = 6 'angle
NumericUpDown2.Maximum = 9
NumericUpDown2.Minimum = 1
NumericUpDown3.Value = -6 'offsetx
NumericUpDown3.Maximum = 30
NumericUpDown3.Minimum = -30
NumericUpDown4.Value = 3 'offsety
NumericUpDown4.Maximum = 30
NumericUpDown4.Minimum = -30
NumericUpDown5.Value = 2 'slice dy
NumericUpDown5.Maximum = 30
NumericUpDown5.Minimum = 0
NumericUpDown6.Value = 8 'slicewidth
NumericUpDown6.Maximum = 30
NumericUpDown6.Minimum = 1
NumericUpDown7.Value = 5 'fuzzy
NumericUpDown7.Maximum = 9
NumericUpDown7.Minimum = 0
NumericUpDown8.Maximum = 9 'fade
NumericUpDown8.Minimum = 0
NumericUpDown8.Value = 0
End Sub
End Class

Similar Messages

  • I need help dividing an image into two equal parts in Adobe Illustrator CC--ASAP!!!

    I need help dividing a single, already created image into 2 equal parts...Am getting nowhere so far

    Hi Willi, thanks so much for responding! Below is the image I need to divide in half. The left half where it says "Click here for the definition" links to a landing page where people can read the definition of the Hebrew Word. The right half links to an audio recording of the Hebrew word being spoken aloud. I am trying to figure out how to use the scissors or knife tool in Adobe Illustrator and am having no luck. Plus I believe there's a way to include URLs on each separated part, but I can't get past figuring out how to cut it. My background is not graphic design

  • CSS mouseover image hover effect in iWeb?

    I've been trying to create an image hover effect when placing the mouse over an image or clicking on the image on my website made in iWeb. The only problem is that the HTML widget doesn't allow the image hover effect to only activate when the mouse is over the widget and not the image. If anyone know some simple code I could put into my website's HTML file, it would be great. It actually doesn't have to be a hover effect, the image just has to change on mouseover.
    My website is temporarily located here: http://dl.dropbox.com/u/19707357/Website/Chocoa/tavlen.html

    I referred you to that page to see if the effect was what you wanted! The examples use javascript.
    You originally asked for CSS and its better to use this since the browser only has to load one image instead of two.
    Here's an example of a rollover using CSS and a sprite...
    http://www.iwebformusicians.com/iweb-snippets/sprite.html

  • Photo Recall Effect -- Changing Part of Screen Captured

    Everything I've tried moves the photo around the screen, but doesn't change what part of the screen appears in the photo. I couldn't find instructions for this in the FCP PDF manual. Does anyone know how to do this? Am I supposed to crop the scene first and then apply the effect or something? Thank you.

    There are two styles in Photo Recall: 1) Classic in which the entire storyline is scaled down to fit inside the picture frame; and 2) Instant in which a small portion of the center of the storyline is fit inside a "polaroid" style frame.
    In order to do what you want requires modifications in Motion...
    After nosing around for a couple of minutes, I realized that those modifications would be too difficult to explain here, so I did them myself and you can download the replacement here:
    http://sight-creations.com/fxexchange/PhotoRecallEnhanced.zip
    It's the exact (almost*) same with the following additions:
    The ability to Rotate the "photo" (the whole "effect")
    The ability to offset the image within the photo by X (Img X Offset) and  Y (Img Y Offset)
    The ability to relatively Scale (this is an offset from the original Scale parameter) the Image within the frame (-50% to 100% parameter setting - actual scale is not easily calculable because there is a difference between the Scaling of the Classic as opposed to the Instant built into the effect [~51% vs ~79%]).
    The ability to Rotate the image inside the photo frame (this is a separate rotation than the photo rotation) from -180° to 180° (if you want more - you'll need to modify this in Motion -- you'll find the parameter settings in the Img Rotation Rig Widget.)
    *I had to replace the "Simple Border" filter applied to the "Classic" inset with two Rectangle shapes: one as an outline for the border and one to create a Mask so that the photo could be maneuvered inside the frame. This keeps this variation of the Effect from being exactly the same as the original. If you don't like the "border" width, or you would like to add that as a parameter for the Effect, you can do so in Motion.
    Hope this helps you out.

  • Hotmail will not display images or some interactive parts of e-mails in firefox but does so in IE 8.

    XP Pro. Firefox V 5.0
    https://www.cmca.net.au/secure/kalgoorlie.htm

    >name="Banner" --><img src="banners/2.jpg"
    alt="banner"
    Sounds like the work of Norton. Don't ever use the word
    'banner' in any part of your images. Rename the image and alt text
    and see if that works.

  • Word document print preview shows entire pasted image, but prints only part of image

    I just bought a new HP 8620.  When doing a copy and paste into Word, everything is shown in the print preview.  However, part of the image, usually the bottom, is not printed.

    Hi nedamirakl,
    Thank you for your response!
    If you copy a photo, does it print the whole picture? Copy Text or Mixed Documents.
    After some further searching, I would recommend to try the shrink to fit option in Word, Shrink to Fit in Word 2010 and Word 2013.
    If that does not work, please try the following:
    Uninstall the software. Uninstalling the Printer Software.
    Clean boot the computer. How to perform a clean boot in Windows.
    Re-install the software using the HP Printer Install Wizard for Windows.
    Hope this helps, and have a nice day!
    RnRMusicMan
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to say “Thanks” for helping!

  • How do I disable the Image Resize Effect?

    The Image class does a zoom resize effect when you change
    it's width and height. How do I disable that? it's .transitions
    array is already empty.

    Thanks Ralph, that fixed it, I did uncheck that box earlier however I had not restarted the computer. Thanks again.

  • Regarding Timo Hahn blog: Handling images/files in ADF (Part 2)

    Hello All, specially Timo Hahn :).
    I am using Jdeveloper 11.1.2.3.0, ADF BC, ADF Faces, Windows 7.
    And I am trying to Handle image/files (download,upload,view for images) from database as explained in Timo's post
    http://tompeez.wordpress.com/2011/11/26/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-2/
    I installed the commons-io-2.4-bin.zip file, but I don't know how to add it to my view controller project.
    Any help is appreciated.

    Thank you,
    But I have one question. I am not expert in Java, but from my understanding the Library is a collection of jar files. So the file I installed is considered a library because it has jar 5 files.
    suppose I want to add the entire library to my project, can we do this:
    By the way I tried to do this by:
    1- double click the view controller project, select library and class path, click the Add Library button.
    2- From the Add Library Window, i clicked the new button.
    3- from the create library window I enter a name and i class path I select the folder contacting these jars and then press OK
    But this did not work for me, and get these errors
    Error(30,29):  package org.apache.commons.io does not exist
    Error(125,13):  cannot find variable IOUtils
    Error(157,13):  cannot find variable IOUtilsBut when I add a single jar to my project it works fine.
    So, is it possible to add the entire library to my project?

  • Displaying Image from Blob as part of JSP

    Hi All,
    In our application we need to display a image as part of a JSP .The image comes as Blob from DB .we are able to save that image local file system but the image is not getting rendered on JSP.We tried converting the Blob to byte[] also.
    we are using the following tag
    <h:graphicImage value="#{beanName.property}" />
    that bean property is a byte array.

    Hi,
    We converted the Blob to byte array but even that does not seem to be working can anyone give the exact h:graphicImage tag that woorked without any servlet code to set it in response.
    Its really urgent.
    Thanks in advance

  • Image Zoom effect

    How is this effect accomplished?
    http://www.collegian.psu.edu/archive/2009/11/16/student_section_to_shift_in_20.aspx 
    Speciffically if you click the image of the seating chart to the right it enlarges.  I looked at the source and there is a small bit of javascript but I can't understand it.  Is it simple or some 3rd party piece?  Thanks for the help!

    Hi
    First it is not java but javascript, there is a big difference between the two.
    When trying to incorporate anything new into a web page it is always better to start with a blank html page, and create what is generally know as a 'proof of concept'. This ensures that you get to understand how to do something without other code getting in the way.
    The links too the two js files, (mootools.js and remooz.js) go in the head content of your page, along with the link to the css file.
    The code shown in the 'how to use' section of the tutorial goes inside the script tags as indicated below, (also inside the head content, but after the links to the js files.
    <script type="text/javascript">
                   /* <![CDATA[ */
                        insert the code here
                   /* ]]> */
              </script>
    You the create an unordered list with a class name of thumbnails and place your image references in this list -
    <ul class="thumbnails">
         <li>
              <a link to large image goes here>
                   <img src= link to small image here/>
              </a>
         </li>
         <li>
              <a href="http://yourwebsitefolder.imagenamelarge.jpg" title="It is an image" >
                   <img src="http://yourwebsitefolder.imagenamesmall.jpg" />
              </a>
         </li>
    The various items in the ReMooz.assign can be customized to your requirements, see - http://digitarald.de/project/remooz/1-0/showcase/simple-caption/.
    PZ

  • Code for image shadow effect

    iWeb creates very nice shadows. Is it a separate image created on the fly or some javascript? Is there any way to get the code that generates that effect? I'd like to extend it to other pages that weren't made in iWeb.
    Thanks in advance.
    Mike

    OK. Here's the solution for anyone interested. A couple of warnings first though: Apple has a naming scheme with the shadows. If you rename "shadow_1" to "shadow_pocket", for example (even if you change it in the HTML file too, it won't work.
    If you saw the code I posted last time, you know how to use one type of shadow. The code below is a javascript file that allows 3 different shadows. Be careful to put braces and parenthesis in the right places. Javascript is a very sensitive language. You can use divs to enclose the images you want to add the shadow effect to. The divs need to have class="tinyText shadow_X", where X is the kind of shadow you want.
    On to the offset… This was actually very easy. It is found in the Javascript below "IWPoint(0.0000,1.0000)". In that example, it literally means that the shadow is offset 1 pixel downward and no horizontal offset. It's a simple (x,y) coordinate system where x and y are the pixel increments from the original image.
    The Javascript code:
    setTransparentGifURL('Media/transparent.gif');function applyEffects()
    {var registry=IWCreateEffectRegistry();registry.registerEffects({shadow_1:new IWShadow({blurRadius:2,offset:new IWPoint(0.0000,1.0000),color:'#000000',opacity:1.000000}),shadow_2:new IWShadow({blurRadius:5,offset:new IWPoint(0.0000,2.0000),color:'#000000',opacity:1.000000}),shadow_0:new IWShadow({blurRadius:5,offset:new IWPoint(0.0000,2.0000),color:'#000000',opacity:1.00000})});registry.applyEffect s();}
    function hostedOnDM()
    {return false;}
    function onPageLoad()
    {loadMozillaCSS('Blank_files/BlankMoz.css')
    fixAllIEPNGs('Media/transparent.gif');applyEffects()}
    Apple has done incredible work on these JavaScript libraries. So, anyone that wants to add beautiful shadows to their images will find these posts helpful.
    Thanks for your help too Old Toad.
    Mike

  • Place an Effect on part of a live group

    Hey all! I'm having an issue I was hoping to find help with.
    I have two parallel lines that I have an effect applied to (zig zag). These lines intersect with two straight parallel lines. I need to paint the box they create. I selected all my lines and created a live group and when I go to paint I get a warning message. All complex visual effects (zig zag) will be removed in order to use live paint. So I figure, 'ok, I'll apply the affect afterwards.'t I only need the zig zag on 2 of the 4 lines, but no matter what I try, once they are a part of that live paint group the effect will apply itself to all four lines. Is there some way that I'm missing? The only thing I can think of at this point it to use the pen tool and to create a line with 100+ tight curves, but that will be extremely time consuming and won't come out as clean and nice looking as the zig zag effect.
    Thanks for any help you guys can give!

    Select the zig zag lines. Choose Object > Expand Appearance... then proceed with Live Paint and what you were trying.
    You have to make the effect permanent in order to keep the appearance and use Live Paint.

  • Individual Image lightbox effect

    Can an individual slide show image be linked to a lightbox effect? The images on my site come up one at a time and are advanced with the forward and back buttons. Ideally I'd like to be able to click on each individual image and have it enlarge while the rest of my site greys out. I know it can be done with multiple thumbnails on a page but I can't figure out how to make it work as I described. Any help would be greatly appreciated. Thanks.

    Hi Steve,
    Please refer to the following link http://forums.adobe.com/message/6119317#6119317
    Cheers!
    Aish

  • Cool Image gallery effect

    I have a thumbnail gallery that opens images of portfolio
    pieces I have done. When you click on the piece, I want a larger
    image to appear. And I've seen this done with flash, where the
    larger image will fill an entire browser. I have built my gallery
    in html, with the piece in a cell. Can I even have this flash
    effect if I'm using Dreamweaver? or does the whole site have to be
    flash? I would love to hear suggestions/ ideas. The site were this
    will go is:
    http://www.accent-mg.com/
    Thanks in advance.
    Brad

    http://www.flashxml.net/cover-flow.html

  • CS3 Premiere Still Image Ghost Effect Before Transition

    I have a timeline with photos that I have automated to the timeline using the default transition between photos. When I render out the video and burn it to disc (the images with dark or black backgrounds are the most noticable) you can see the next image in line that is to be shown briefly through the image that is currently on screen. It's almost like a ghosting effect of the next image like it is in a holding pattern waiting to dissolve into the image. This seems to occur throughout the timeline but as I said, it is much more obvious on images with dark or black backgrounds.
    I'm pretty sure I've had this problem in the past and don't remember how I resolved it. In rendering, I render out to an NTSC DV AVI file and import into Encore 2 and let Encore 2 handle the file rendering.
    If someone could enlighten me on what the issue may be that I could quickly resolve, I would appreciate it. In the meantime, I will try other ways of kicking the file out to see if I get any better desired results.
    Thanks in advance.

    can you put a screenshot of your timeline with the still images on it here ???? that might help us see what your transistions
    are doing etc...tell us more about what transition you're using ( cross dissolve ? ..) stuff like that...

Maybe you are looking for