Page 1 of 1
Problems with block colour lines All colour lines of blocks changes to black!
#1
Posted 30 August 2007 - 11:03 AM
All colour lines of blocks changes to black when I modify their properties (SetProperties) when the blocks are not visible on the screen.
On the first sample picture appears original block, with true colour lines.
On the second image appears same block after a mirror operation, with an incorrect colour lines. The mirror operation became while the block was not visible on the screen (using scroll).
Thanks,
Andreu.
On the first sample picture appears original block, with true colour lines.
On the second image appears same block after a mirror operation, with an incorrect colour lines. The mirror operation became while the block was not visible on the screen (using scroll).
Thanks,
Andreu.
#8
Posted 12 November 2007 - 10:12 AM
Every time you are using SetProperties to a line AVAX makes a new line object with a rendering order grater than the rendering order of the blocks. The idea is to use command SetProperties to the blocks too. By this way AVAX will render blocks after the lines. See the following VB6 example:
Option Explicit
Dim hLine As Long
Dim hBlock As Long
Private Sub Command1_Click()
Dim h() As Long, iType() As AvaxItemType, vProp() As Variant, vData() As Variant
Dim xyz() As Single
ReDim h(1) As Long
h(1) = hLine
cAvax1.AutoRedraw = False
If cAvax1.GetProperties(h(), iType(), vProp(), vData()) = True Then
xyz() = vData(1)
xyz(1) = xyz(1) + 1
xyz(2) = xyz(2) + 1
vData(1) = xyz()
Call cAvax1.SetProperties(h(), iType(), vProp(), vData())
hLine = cAvax1.LastHandle
End If
Call SetPropertiesToTheBlock
cAvax1.AutoRedraw = True
End Sub
Private Sub SetPropertiesToTheBlock()
Dim h() As Long, iType() As AvaxItemType, vProp() As Variant, vData() As Variant
Dim xyz() As Single
ReDim h(1) As Long
h(1) = hBlock
If cAvax1.GetProperties(h(), iType(), vProp(), vData()) = True Then
Call cAvax1.SetProperties(h(), iType(), vProp(), vData())
hBlock = cAvax1.LastHandle
End If
End Sub
Private Sub Form_Load()
Dim Fill_Flags As Long, h() As Long
Dim hShape As Long
Command1.Caption = "Set properties to the Line"
Call cAvax1.StartAvax
Call cAvax1.SetAvaxProperty(CheckBackColorOn_p, False)
Call cAvax1.DirsSet("", "", App.Path & "\", "")
hLine = cAvax1.Add_Line(5, -5, 0, 5, 10, 0, , cAvax1.NearestPaletteIndexColor(vbBlack))
Fill_Flags = cAvax1.CreatePatternFlags(, , , True)
hShape = cAvax1.Add_ShapeRectangle(0, 0, 20, 5, , , , cAvax1.NearestPaletteIndexColor(vbWhite), 0, , , Fill_Flags, , 2)
ReDim h(1) As Long
h(1) = hShape
If cAvax1.CreateBlock(h(), "test", 0, 0) = True Then
hBlock = cAvax1.LastHandle
End If
cAvax1.Command = AutoLimits_c
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call cAvax1.EndAvax
End Sub
Athanasios Gardos
Avax-Software.com
Avax-Software.com
#9
Posted 12 November 2007 - 05:09 PM
Thanks, we already are applying this method to solve the problem of ZOrder.
But the problem that we realy fail to solve is the loss of the block colour lines after aplying SetProperties.
I apply SetProperties to all blocks. But all colour lines of blocks changes to black when the blocks are not visible on the screen!
I tested it on the latest Avax version v.1.3.77 (14-SEP-2007).
But the problem that we realy fail to solve is the loss of the block colour lines after aplying SetProperties.
I apply SetProperties to all blocks. But all colour lines of blocks changes to black when the blocks are not visible on the screen!
I tested it on the latest Avax version v.1.3.77 (14-SEP-2007).
#10
Posted 31 December 2007 - 10:00 AM
Hi!
This is an example code in .NET:
To avoid this Avax bug, we must previously do “ZoomExtends” and after “SetProperties” we set zoom to original view.
Thanks,
Andreu.
This is an example code in .NET:
Public Sub BringToFront_AllBlocks() ' ' Set all existing blocks to front from the drawing ' 'Local declarations Dim AllHandles() As Integer Dim AvaxType() As Avax.AvaxItemType Dim objProp() As Object Dim objData() As Object 'Obtain all existing blocks properties If AxcAvax1.GetAllHandlesArr(AllHandles, Avax.AvaxItemType.Block_i, False) < 1 Then Exit Sub End If If Not AxcAvax1.GetProperties(AllHandles, AvaxType, objProp, objData) Then Exit Sub End If 'AVAX BUG on "SetProperties" of blocks: 'if these are not visible on the screen the original colour lines losts! And all colour lines of blocks changes to black! 'To avoid this situation, we previously do "ZoomExtends", and after "SetProperties" back to the initial zoom view. Dim MaxXMin, MaxYMin, MaxXMax, MaxYMax As Single Dim ActualXMin, ActualYMin, ActualXMax, ActualYMax As Single AxcAvax1.GetBoundsDrawing(MaxXMin, MaxYMin, Nothing, MaxXMax, MaxYMax, Nothing) 'maximum bounds of drawing area AxcAvax1.GetBoundsZoom(ActualXMin, ActualYMin, ActualXMax, ActualYMax) 'actual zoom position If ActualXMin > MaxXMin Or ActualYMin > MaxYMin Or ActualXMax < MaxXMax Or ActualYMax < MaxYMax Then 'if all drawing are not visible AxcAvax1.Command = 84 'zoom extends End If 'Set all blocks properties to do "BringToFront" AxcAvax1.SetProperties(AllHandles, AvaxType, objProp, objData) 'AVAX BUG on "SetProperties" of blocks: set to original zoom view If ActualXMin > MaxXMin Or ActualYMin > MaxYMin Or ActualXMax < MaxXMax Or ActualYMax < MaxYMax Then ' if all drawing was not visible AxcAvax1.SetBoundsZoom(ActualXMin, ActualYMin, ActualXMax, ActualYMax) 'set to original zoom view End If End Sub
To avoid this Avax bug, we must previously do “ZoomExtends” and after “SetProperties” we set zoom to original view.
Thanks,
Andreu.
Page 1 of 1
Sign In
Register
Help
Add Reply

MultiQuote