This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, July 31, 2006 7:27:03 AM(UTC)
Groups: Registered
Posts: 3
With LEAD
.ScaleMode = 3 'pixels
.DrawMode = DRAWMODE_COPY_PEN
.DrawPenColor = RGB(255, 0, 0)
.DrawPenStyle = DRAWPENSTYLE_SOLID
.DrawPenWidth = 4
.DrawFillStyle = DRAWFILLSTYLE_TRANSPARENT
.DrawPersistence = True
.DrawRectangle 422, 162, 150, 64
End with
For some reason it draws BLACK rectangle instead of RED.
Any ideas?
P.S I use LTOCX14N.ocx
thanks
#2
Posted
:
Tuesday, August 1, 2006 10:54:24 AM(UTC)
Groups: Registered
Posts: 2
I think you need to use the fill color:
.DrawFillColor = VBA.RGB(255, 0, 0)
#3
Posted
:
Tuesday, August 1, 2006 10:58:30 AM(UTC)
Groups: Registered
Posts: 3
none of the colors work (fill or pen)
Another thing is: when I change .DrawPersistence to FALSE my rectangle dissappears....
#4
Posted
:
Wednesday, August 2, 2006 9:47:57 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
When I use the following code, I can change the color of the rectangle by changing the LEAD1.DrawPenColor property.
LEAD1.DrawPenStyle = DRAWPENSTYLE_SOLID
LEAD1.DrawPenWidth = 2
LEAD1.DrawPenColor = RGB(255, 255, 0)
LEAD1.DrawMode = DRAWMODE_COPY_PEN
LEAD1.DrawPersistence = True 'On the bitmap
LEAD1.DrawRectangle 0, 0, 75, 75
I think the problem is that your bitmap is only 1 bits per pixel which means all colors will be black or white. You can check this by looking at the BitmapBits property. If it is 1, you should change it to a higher value such as 24 to make it a full color image using ColorRes method. This method is documented with sample code in the help file.
You should only set the DrawPersistence property to false if you want to draw to the screen. If you draw it to the screen and your bitmap is repainted , the rectangle will go away. If you want to draw directly on the bitmap and not have to handle all the painting yourself, set this to true.
#5
Posted
:
Wednesday, August 2, 2006 10:12:19 AM(UTC)
Groups: Registered
Posts: 3
Thanks a lot,
I followed your recommendations and it works now.
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.