Click here to Skip to main content
15,881,559 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I'm creating a rectangle on width example 800px and height 150px. I do animation storyboard which appearing a canvas with rectangle filled by image byte. But the things is the rectangle change the width to 300px and indent to left.

How this things happen and a way to do it? Below are my code to fill the rectangle with image which Stretch = Uniform.

VB
Dim view_logobyte() As Byte = arr_info.Item(i).arrLogo
If Not (IsNothing(view_logobyte)) Then
    imgBrush = Nothing
    imgBrush = New ImageBrush
    Using stream = New MemoryStream(view_logobyte)
        Dim bitmap = New BitmapImage()
        bitmap.BeginInit()
        bitmap.StreamSource = stream
        bitmap.CacheOption = BitmapCacheOption.OnLoad
        bitmap.EndInit()
        bitmap.Freeze()
        imgBrush.ImageSource = bitmap
        stream.Dispose()
    End Using
    view_reclogo.Stretch = Stretch.Uniform
    view_reclogo.Fill = imgBrush
End If
Dim mystoryboard As New Storyboard
mystoryboard = CType(Me.Resources("come_details"), Storyboard)
AddHandler mystoryboard.Completed, AddressOf comedetails_completed
mystoryboard.Begin(Me)

The things is when I test the animation on Blend, the rectangle show as what I want; an image is in Uniform where it will be center of the rectangle. When debugging the program, it retrieve byte from database from blob and at storyboard running, the rectangle width become short
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900