Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
jcavard  
#1 Posted : Monday, December 5, 2005 3:48:17 AM(UTC)
jcavard

Rank: Member

Groups: Member
Joined: 12/5/2005(UTC)
Posts: 3

Hi! I am designing a ClipArt Manager. It will be images of plants and hard goods (pergolas, fountain ...) intended to landscape designer. The main goal of this application is to drag and drop elements of the ClipArt Manager onto a picture of an unfinnished house landscaping. That's why it has to keep transparency.

I need to be able to

-drag image from folder on disk and drop them into our clipart manager, keeping it's transparency
-drag image from COREL Designer & Photo-Paint and drop them into our clipart manager, keeping it's transparency
-drag image from our clipart manager and drop them into COREL Designer & Photo-Paint keeping their transparency.

So far I been able to drop file from folder into our application, but it does NOT keep TOTAL transparency (see the screenshot below)....

Code:
    Private Sub PictureBox1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles PictureBox1.DragDrop
        Dim img As Image
        Dim sFile() As String
        Dim i, j As Integer
        Dim itm As New ListViewItem

        Try
            If e.Data.GetDataPresent(DataFormats.FileDrop) Then ' Image File being dropped

                sFile = e.Data.GetData(DataFormats.FileDrop)

                For j = 0 To sFile.Length - 1
                    Dim reader As Aurigma.GraphicsMill.Codecs.FormatReader = _
                        Aurigma.GraphicsMill.Codecs.FormatManager.CreateFormatReader(sFile(j))
                    Dim bitmap As New Aurigma.GraphicsMill.Bitmap

                    For i = 0 To reader.FrameCount - 1
                        Dim frame As Aurigma.GraphicsMill.Codecs.Frame = reader.LoadFrame(i)

                        frame.GetBitmap(bitmap)
                        frame.Dispose()

                        PictureBox1.Image = bitmap.ToGdiplusBitmap
                        itm.ImageIndex = ImageList1.Images.Count
                        itm.Text = "Y bomasse toé"
                        ImageList1.Images.Add(bitmap.ToGdiplusBitmap)
                        ListView1.Items.Add(itm)
                        ListView1.Items(0).Selected = True

                    Next

                    bitmap.Dispose()
                    reader.Dispose()
                Next

            ElseIf e.Data.GetDataPresent(DataFormats.Dib) Then  ' Image dragged from Corel Designer

                'HandleDropOrPaste(e.Data)
                Dim stm As MemoryStream = e.Data.GetData(DataFormats.Dib)
                'reader = New TiffReader(stm)

                Dim reader As Aurigma.GraphicsMill.Codecs.FormatReader = _
                    Aurigma.GraphicsMill.Codecs.FormatManager.CreateFormatReader(stm)

                Dim bitmap As New Aurigma.GraphicsMill.Bitmap

                For i = 0 To reader.FrameCount - 1
                    Dim frame As Aurigma.GraphicsMill.Codecs.Frame = reader.LoadFrame(i)
                    frame.GetBitmap(bitmap)
                    frame.Dispose()

                    'bitmap.Save("c:\frame_" & i & ".jpg")
                    PictureBox1.Image = bitmap.ToGdiplusBitmap

                    itm.ImageIndex = ImageList1.Images.Count
                    itm.Text = "Y bomasse toé"
                    ImageList1.Images.Add(bitmap.ToGdiplusBitmap)
                    ListView1.Items.Add(itm)
                    ListView1.Items(0).Selected = True



                Next

                bitmap.Dispose()

                reader.Dispose()


            End If

        Catch ex As Exception
            MsgBox(ex.ToString)
        Finally
        End Try
    End Sub


this is how it look.
UserPostedImage
UserPostedImage

Edited by user Monday, December 21, 2009 3:00:20 AM(UTC)  | Reason: Not specified

jcavard attached the following image(s):
21212.jpg
55.jpg
web designer from http://www.neta.ca/en/
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.