利用API 實現 字串的映象 二

2021-03-31 08:56:29 字數 989 閱讀 4179

private declare function stretchblt lib "gdi32" (byval hdc as long, byval x as long, byval y as long, byval nwidth as long, byval nheight as long, byval hsrcdc as long, byval xsrc as long, byval ysrc as long, byval nsrcwidth as long, byval nsrcheight as long, byval dwrop as long) as long

private const srccopy = &hcc0020

private withevents pic1 as picturebox

sub form_click()

dim w as integer, h as integer

pic1.print "人之初" & vbcrlf & "性本善"

w = pic1.scalewidth

h = pic1.scaleheight

stretchblt me.hdc, w, h, -w, h, pic1.hdc, 0, 0, w, h, srccopy

stretchblt me.hdc, 3 * w, h, -w, h, pic1.hdc, 0, 0, w, h, srccopy

stretchblt me.hdc, w, h, w, -h, pic1.hdc, 0, 0, w, h, srccopy

stretchblt me.hdc, w, 3 * h, w, -h, pic1.hdc, 0, 0, w, h, srccopy

end sub

效果如下:

利用API 實現字串表示式的計算

下面實現字串表示式 計算 由筆者收藏的本論壇 改編,記不清是哪位提供的了,非常感謝。option explicit private declare function ebexecuteline lib vba6.dll byval pstringtoexec as long,byval unknow...

字串常用的API

獲取字串的長度 str.length 長度裡面包括字串之間的空格以及標點符號 let str hellow world console.log str.length 列印結果為12 獲取字串給定索引位置的字元 chartat let str hellow world console.log str....

字串的迴文與映象

給你一個字串,如何判斷這個字串是不是迴文串和映象串。看試一道很簡單的題,但真正能把握住這道題卻很難!下面介紹三種方法,各有亮點 第一種方法 先把可以映象的字元用hash表給儲存起來,給出的字串的一半入棧,如果這個字串的長度為奇數,則這個字串中間這個字元如果映象後的字元和原來不相同,則這個字串肯定不是...

常用字串API實現(筆試會考)

1.puts 輸出 程式設計思路 因為字串有 0 結尾這一特點。就可以去用putchar 也可以用printf 一個一個輸出字元並且判斷字串是否到達尾巴。注意 用指標的話要注意指標的偏移 include include void myputs char p putchar n int main 2....

自己實現C語言的一些字串API

函式原型 intputs const char s char gets char s size t strlen const char s void memset void s,int c,size t n char strcpy char dest,const char src char strn...