OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 27-12-2012, 22:24
iceage3 iceage3 is offline
Junior Member
 
Join Date: May 2009
Posts: 19
Default Help! how to make a picture preview by using Image Control,just like Calendar Wizard?

Just do this, without make a ocx outside the gms file and do not reference anything, someone can help?
Reply With Quote
  #2  
Old 27-12-2012, 23:02
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,788
Blog Entries: 12
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Image Control for Calendar Wizard

The Calendar Wizard and other macros by Alex use the UI Extension Library or SCPRTL20.DLL The .dll has shipped with CorelDRAW for several versions now, so it is pretty safe to use. You can find detailed information about it here:

User Interface Extension Library 2.0

And the VBA interface to the DLL's functions here:

UI Extension Library VBA Interface

Hope that helps.

-Shelby
Reply With Quote
  #3  
Old 28-12-2012, 00:35
iceage3 iceage3 is offline
Junior Member
 
Join Date: May 2009
Posts: 19
Default

That's pretty cool, thank you so much Shelbym!
I think this may take me quite a while to learn, thanks to the mighty Alex too!
Reply With Quote
  #4  
Old 28-12-2012, 20:56
iceage3 iceage3 is offline
Junior Member
 
Join Date: May 2009
Posts: 19
Default

Shelbym, this User Interface dll is easy to use ,but when I tried to read data in memory, I find the GetPixel method is slow, is there some other better way to do this? Below is my code, if you have time, please try it. Thanks!

The bmp file is in the attachment, and its location is "c:\tmp_bitmap.bmp"

'Here is the code
Dim R&(), G&(), B&()

Sub rd()
Dim BackColor&, s$

BackColor = vbWhite
BeginImage 1000, 1000, BackColor
ImageDrawBitmap "c:\tmp_bitmap.bmp", 0, 0 ' load a bitmap on disk, width of bitmap:1000, height of bitmap :1000

MsgBox "Begin to Read the bitmap"
ReadColor 1, 1, 1000, 1000 'read the loaded bitmap into three arrays, R(),G(),B(), pixel by pixel
MsgBox "Done"

'finish
s = "c:\Temp123.bmp"
EndImage s
Kill s
End Sub


Public Sub ReadColor(Rx1%, Ry1%, Rx2%, Ry2%)
Dim xx&, yy&, Color&
ReDim R(1 To 1000, 1 To 1000), G(1 To 1000, 1 To 1000), B(1 To 1000, 1 To 1000)
'Read bitmap in memory pixel by pixel
For xx = Rx1 To Rx2
For yy = Ry1 To Ry2
Color = GetPixel(xx, yy)
If Color = -1 Then Color = 16777215

R(xx, yy) = Color Mod 256&
G(xx, yy) = ((Color And &HFF00) / 256&) Mod 256&
B(xx, yy) = (Color And &HFF0000) / 65536
Next yy
Next xx
End Sub
Attached Files
File Type: zip tmp_bitmap.zip (416.2 KB, 352 views)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there any point making your own calendar using 'Word' calendar wizard? Jennkins Calendar Wizard 1 07-02-2011 07:39
Calendar Wizard for X4 ? stadeverois Calendar Wizard 3 21-05-2008 23:13
Calendar wizard v3.3 bobi_mbc Calendar Wizard 1 20-12-2007 06:48
Cannot Use Calendar Wizard tonk Calendar Wizard 4 25-11-2005 01:53
Image picture location RVogel CorelDRAW/Corel DESIGNER VBA 0 31-03-2005 12:05


All times are GMT -5. The time now is 01:35.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com