home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / bmp_kit / bmpkit.frm (.txt) < prev    next >
Visual Basic Form  |  1995-02-26  |  8KB  |  180 lines

  1. Form1
  2. Form1
  3. Form1%
  4. Command4
  5. Show Original 
  6. Command5
  7. Hide Original
  8. Command3
  9. Print
  10. Command2
  11. Display
  12. HScroll1    
  13. Option2
  14. Picture2
  15. Option1
  16. VScroll1
  17. Command1
  18. Picture1
  19. Label3
  20. Label2
  21. Label1
  22. Scaled Image
  23. Form_Click
  24. @    Form_Loadx
  25. Picture2
  26.     scalemode
  27. width
  28. height
  29. hscroll1S
  30. hscroll
  31. smallchange
  32. largechange<
  33. values
  34. vscroll1
  35. picture1
  36. visible
  37. PictureZ
  38. scalex)
  39. scaleyA
  40. command2_click
  41. Command1_Click
  42. picture3
  43. moveflag
  44.     scaleflag
  45. defaultmargin
  46. leftY
  47. SRCCOPY
  48. NEWFRAME/
  49. pixel
  50. graphicfile
  51. printer
  52. printgraphicx
  53. littlex
  54. printgraphicy
  55. littleyI
  56. scalewidth
  57. scaleheight
  58.     hMemoryDCe
  59. CreateCompatibleDC
  60. hOldBitMap
  61. SelectObject
  62. ApiError
  63. StretchBlt
  64. DeleteDC    
  65.     constants
  66. calls6
  67. Command3_Click
  68. requires
  69. coordinates
  70. graphic
  71. match
  72. current
  73. inchk
  74.     positionsR
  75.     invisible
  76. form1
  77. certain 
  78. factors
  79. Command4_Click
  80. Command5_ClickW
  81. HScroll1_Change
  82. option2?
  83. option1
  84. Check1_Click3
  85. check1
  86. xyproportion
  87. VScroll1_ChangeK
  88. above
  89. selected
  90. positive
  91. currentx
  92. currenty
  93.     drawwidth
  94. Command1_Click
  95. command2_click
  96. Make sure we have valid scaling values
  97. Set picture2.width to match picture1, with scaling.V
  98. The 3.14 divisor matches inch dimension with the
  99. 640X480 screen dimensions. Change for other displayy
  100. adapters..
  101. *Set constants for GDI calls
  102. *Display scaled version in Picture2a
  103. *StretchBlt requires pixel coordinates..
  104. Set Dimensions for Picture2c
  105. *Do not change the order of these statements.
  106. Variables for the StretchBlt function:
  107. 1. Source of image HMemeoryDC% -- set above from original picturee
  108. 2,3. Positioning on output object. Must be integer, in pixels.
  109. 4,5. Width, height of output image. Here we use the values set above.r
  110. 6, Source of image...in this case the memory image set by CreateCompatibleDC% function
  111. 7,8. Don't know. Set to 0 works just fine! Experiment and let me know.
  112. 9,10. X/Y coordinates for how much of original to put in new object. You can use
  113. these values for cropping, if you like..
  114. 11. SRCCOPY, as set in constants above. Change at own risk..
  115. *Reset scalemodes to previous inch valuess
  116. Command3_Click
  117. * Print all items other than the image first..
  118. Hello
  119. *After printing all other elements include your BMPP
  120. printing routine, as below.l
  121. * Print Scaled Image
  122. *Make certain we have valid scaling values
  123. *Set GDI Constants
  124. * StretchBlt requires pixel coordinates.
  125. *First two variables are the x,y coordinates (in Pixels)
  126. for the placement of images on the printed page. Since the
  127. form's ScaleMode is 5 for inches, multiply by 300 to
  128. match the the current inch positions of Picture2 onn
  129. the 300 DPI device.n
  130. *Second pair of variables set the height and width of thee
  131. graphic to match the pixel size of the original picturee
  132. in the invisible Picture1 box.
  133. *Do not change the order of these statements.a
  134. Variables for the StretchBlt function:
  135. 1. Source of image HMemeoryDC% -- set above from original picturec
  136. 2,3. Positioning on output object. Must be integer, in pixels.
  137. 4,5. Width, height of output image. Here we use the values set above.Y
  138. 6, Source of image...in this case the memory image set by CreateCompatibleDC% function
  139. 7,8. Don't know. Set to 0 works just fine! Experiment and let me know.
  140. 9,10. X/Y coordinates for how much of original to put in new object. You can use
  141. these values for cropping, if you like.r
  142. 11. SRCCOPY, as set in constants above. Change at own risk.w
  143. *Send image and text to printers
  144. Command4_Click
  145. Command5_Click
  146. Form_Load
  147. *set form and picture ScaleModes
  148. set the Move optionn
  149. set initial picture width
  150. *Setup scroll bar values
  151. *Set Horizontal Scrollbar to center
  152. *Set Vertical Scrollbar to centere
  153. *Make Picture1 box invisible...This picture box, which
  154. holds the basic image, does not have to show.  Note that
  155. we'll use the printer resolution of this box for sizing.
  156. For example, a 300X300 pixel image will print as 1X1 inchh
  157. on a laser printer..
  158. *Load bitmap into Picture1 ... put PAPER.BMP, a Windowss
  159. background image in the VB directory, or in the defaultt
  160. directory, or change the filespec to match it's location.
  161. Choose your own, or let user load.
  162. RIBBONS.BMP
  163. *Set scaling factors to 1 for full-size image.
  164. To reduce or enlarge the original when first displayed,
  165. change these figures.t
  166. *Display Picture in Picture2
  167. HScroll1_Change
  168. *If the Move option is selected (default) then add the positive or
  169. negative Value of Hscroll1 to the top left of the picture,
  170. redraw. Notice that the multiplier is .01 to deal with the
  171. inch settings. Scroll Values must be integers., so we cane
  172. move in .01 inch increments.
  173. If the Size option is selected, then add the positive or
  174. negative Value of Hscroll1 to the scalex variable, thenn
  175. redraw. Notice that the multiplier is .01 to deal with the
  176. inch settings. Scroll Values must be integers., so we cann
  177. move in .01 inch increments.
  178. VScroll1_Change
  179. *See Hscroll1_Change for explanations.
  180.