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 : Tuesday, June 27, 2006 9:09:33 PM(UTC)
babyhead

Groups: Registered
Posts: 2


Dear Sir:
  Thanks for ur reply. I have another question about VECTOR Imaging using ActiveX. I saw there are methods in API and Classlib interfaces called SetObjectAttributes. I can use this method to change the brush style from standard brush to gradient brush without showing the edit object dialog. However, i can not find the relative method in COM/Active interface. I have tried to set the BrushStyle property of  ILEADVectorObject interface, but it seems not working. Please see a sample code below:
  Assume pObject refers to a valid ILEADVectorObject whose type is VECTOR_POLYDRAW and the BrushStyle property of this object is VECTORBRUSH_STANDARD. I used the flollowing code to change the BrushStyle to VECTORBRUSH_GRADIENT:
  pObject ->SetBrushStyle(VECTORBRUSH_GRADIENT);
  long lBrushType= pObject ->GetBrushStyle();
  It seems that the frist statement has no effect and the returned BrushStyle  is still VECTORBRUSH_STANDARD. What's wrong with my code?Could you help me about that? Or could you provided me a sample that changes the brush style of selected objects in a vector control from VECTORBRUSH_STANDARD to VECTORBRUSH_GRADIENT without showing the edit object dialog? Thanks.
 
Best Regards
 
W Yuan
 
2006.06.28
 
 

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 : Thursday, June 29, 2006 10:08:17 AM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 367

Was thanked: 1 time(s) in 1 post(s)

You can use the API with the OCX. I tested using our OCX vector MFC demo as follows:
1. Add the following lines for the Header and LIB files:
#define _LTERR_H_ //exclude the API error codes
#include <l_bitmap.h>
#pragma comment (lib, "lvkrn_n.lib") //use lvkrn_E.lib with the Evaluation edition

2. The code will be like this:
//m_LEADVector1 is of type CLEADVector
pVECTORHANDLE pVectorHandle = pVECTORHANDLE(m_LEADVector1.GetVector());
// pObject is of type (CLEADVectorObject*), which is the object we want to change
pVECTOROBJECT pVectorObject = pVECTOROBJECT(pObject->GetHObject());
VECTORBRUSH vecBrush;
int n = L_VecGetObjectAttributes(pVectorHandle, pVectorObject, NULL, NULL, &vecBrush, NULL);
vecBrush.VectorBrushStyle = VECTORBRUSH_GRADIENT;
vecBrush.BrushType.GradientBrush.crStartColor = RGB(255, 120, 255);
vecBrush.BrushType.GradientBrush.crEndColor = RGB(70, 255, 120);
vecBrush.BrushType.GradientBrush.uGradientSteps = 255;
vecBrush.BrushType.GradientBrush.GradientStyle = GRADIENT_CONE_FROM_LB;
n=L_VecSetObjectAttributes(pVectorHandle, pVectorObject, NULL, NULL, &vecBrush, NULL, 0);

Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
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-2024, Yet Another Forum.NET
This page was generated in 0.117 seconds.