Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, July 31, 2006 7:27:03 AM(UTC)

olga  
olga

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

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, August 1, 2006 10:54:24 AM(UTC)

RichZZZ  
RichZZZ

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)

olga  
olga

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)

Otis  
Guest

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)

olga  
olga

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.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.079 seconds.